﻿namespace Email.Tests

open Expecto
open FsRegEx

module OneAtSign =

    let oneAtSign (email : string) =
        if email.StartsWith("@") || email.EndsWith("@") then
            false
        else
            let s = email.Split '@'
            
            if s.Length = 1 then
                false
            else
                if s.Length = 2 then
                    true
                else
                    let x = 
                        Array.take (s.Length - 1) s
                        |> Array.filter (fun x -> x.Contains("\"") )
                    x.Length = (s.Length - 1)

    [<Tests>]
    let testOneAtSign =
        testList "OneAtSign" [
            RFC822.test1 oneAtSign 
            RFC822.test2 oneAtSign
            RFC822.test3 oneAtSign
            RFC822.test4 oneAtSign
            RFC822.test5 oneAtSign
            RFC822.test6 oneAtSign
            RFC822.test7 oneAtSign
            RFC822.test8 oneAtSign
            RFC822.test9 oneAtSign
            RFC822.test10 oneAtSign
            RFC822.test11 oneAtSign
            RFC822.test12 oneAtSign
            RFC822.test13 oneAtSign
            RFC822.test14 oneAtSign
            RFC822.test15 oneAtSign
            RFC822.test16 oneAtSign
            RFC822.test17 oneAtSign
            RFC822.test18 oneAtSign
            RFC822.test19 oneAtSign
            RFC822.test20 oneAtSign
            RFC822.test21 oneAtSign
            RFC822.test22 oneAtSign
            RFC822.test23 oneAtSign
            RFC822.test24 oneAtSign
            RFC822.test25 oneAtSign
            RFC822.test26 oneAtSign
            RFC822.test27 oneAtSign
            RFC822.test28 oneAtSign
            RFC822.test29 oneAtSign
            RFC822.test30 oneAtSign
            RFC822.test31 oneAtSign
            RFC822.test32 oneAtSign
            RFC822.test33 oneAtSign
            RFC822.test34 oneAtSign
            RFC822.test35 oneAtSign
            RFC822.test36 oneAtSign
            RFC822.test37 oneAtSign
            RFC822.test38 oneAtSign
            RFC822.test39 oneAtSign
            RFC822.test40 oneAtSign
            RFC822.test41 oneAtSign
            RFC822.test42 oneAtSign
            RFC822.test43 oneAtSign
            RFC822.test44 oneAtSign
            RFC822.test45 oneAtSign
            RFC822.test46 oneAtSign
            RFC822.test47 oneAtSign
            RFC822.test48 oneAtSign
            RFC822.test49 oneAtSign
            RFC822.test50 oneAtSign
            RFC822.test51 oneAtSign
            RFC822.test52 oneAtSign
            RFC822.test53 oneAtSign
            RFC822.test54 oneAtSign
            RFC822.test55 oneAtSign
            RFC822.test56 oneAtSign
            RFC822.test57 oneAtSign
            RFC822.test58 oneAtSign
            RFC822.test59 oneAtSign
            RFC822.test60 oneAtSign
            RFC822.test61 oneAtSign
            RFC822.test62 oneAtSign
            RFC822.test63 oneAtSign
            RFC822.test64 oneAtSign
            RFC822.test65 oneAtSign
            RFC822.test66 oneAtSign
            RFC822.test67 oneAtSign
            RFC822.test68 oneAtSign
            RFC822.test69 oneAtSign
            RFC822.test70 oneAtSign
            RFC822.test71 oneAtSign
            RFC822.test72 oneAtSign
            RFC822.test73 oneAtSign
            RFC822.test74 oneAtSign
            RFC822.test75 oneAtSign
            RFC822.test76 oneAtSign
            RFC822.test77 oneAtSign
            RFC822.test78 oneAtSign
            RFC822.test79 oneAtSign
            RFC822.test80 oneAtSign
            RFC822.test81 oneAtSign
            RFC822.test82 oneAtSign
            RFC822.test83 oneAtSign
            RFC822.test84 oneAtSign
            RFC822.test85 oneAtSign
            RFC822.test86 oneAtSign
            RFC822.test87 oneAtSign
            RFC822.test88 oneAtSign
            RFC822.test89 oneAtSign
            RFC822.test90 oneAtSign
            RFC822.test91 oneAtSign
            RFC822.test92 oneAtSign
            RFC822.test93 oneAtSign
            RFC822.test94 oneAtSign
            RFC822.test95 oneAtSign
            RFC822.test96 oneAtSign
            RFC822.test97 oneAtSign
            RFC822.test98 oneAtSign
            RFC822.test99 oneAtSign
            RFC822.test100 oneAtSign
            RFC822.test101 oneAtSign
            RFC822.test102 oneAtSign
            RFC822.test103 oneAtSign
            RFC822.test104 oneAtSign
            RFC822.test105 oneAtSign
            RFC822.test106 oneAtSign
            RFC822.test107 oneAtSign
            RFC822.test108 oneAtSign
            RFC822.test109 oneAtSign
            RFC822.test110 oneAtSign
            RFC822.test111 oneAtSign
            RFC822.test112 oneAtSign
            RFC822.test113 oneAtSign
            RFC822.test114 oneAtSign
            RFC822.test115 oneAtSign
            RFC822.test116 oneAtSign
            RFC822.test117 oneAtSign
            RFC822.test118 oneAtSign
            RFC822.test119 oneAtSign
            RFC822.test120 oneAtSign
            RFC822.test121 oneAtSign
            RFC822.test122 oneAtSign
            RFC822.test123 oneAtSign
            RFC822.test124 oneAtSign
            RFC822.test125 oneAtSign
            RFC822.test126 oneAtSign
            RFC822.test127 oneAtSign
            RFC822.test128 oneAtSign
            RFC822.test129 oneAtSign
            RFC822.test130 oneAtSign
            RFC822.test131 oneAtSign
            RFC822.test132 oneAtSign
            RFC822.test133 oneAtSign
            RFC822.test134 oneAtSign
            RFC822.test135 oneAtSign
            RFC822.test136 oneAtSign
            RFC822.test137 oneAtSign
            RFC822.test138 oneAtSign
            RFC822.test139 oneAtSign
            RFC822.test140 oneAtSign
            RFC822.test141 oneAtSign
            RFC822.test142 oneAtSign
            RFC822.test143 oneAtSign
            RFC822.test144 oneAtSign
            RFC822.test145 oneAtSign
            RFC822.test146 oneAtSign
            RFC822.test147 oneAtSign
            RFC822.test148 oneAtSign
            RFC822.test149 oneAtSign
            RFC822.test150 oneAtSign
            RFC822.test151 oneAtSign
            RFC822.test152 oneAtSign
            RFC822.test153 oneAtSign
            RFC822.test154 oneAtSign
            RFC822.test155 oneAtSign
            RFC822.test156 oneAtSign
            RFC822.test157 oneAtSign
            RFC822.test158 oneAtSign
            RFC822.test159 oneAtSign
            RFC822.test160 oneAtSign
            RFC822.test161 oneAtSign
            RFC822.test162 oneAtSign
            RFC822.test163 oneAtSign
            RFC822.test164 oneAtSign
            RFC822.test165 oneAtSign
            RFC822.test166 oneAtSign
            RFC822.test167 oneAtSign
            RFC822.test168 oneAtSign
            RFC822.test169 oneAtSign
            RFC822.test170 oneAtSign
            RFC822.test171 oneAtSign
            RFC822.test172 oneAtSign
            RFC822.test173 oneAtSign
            RFC822.test174 oneAtSign
            RFC822.test175 oneAtSign
            RFC822.test176 oneAtSign
            RFC822.test177 oneAtSign
            RFC822.test178 oneAtSign
            RFC822.test179 oneAtSign
            RFC822.test180 oneAtSign
            RFC822.test181 oneAtSign
            RFC822.test182 oneAtSign
            RFC822.test183 oneAtSign
            RFC822.test184 oneAtSign
            RFC822.test185 oneAtSign
            RFC822.test186 oneAtSign
            RFC822.test187 oneAtSign
            RFC822.test188 oneAtSign
            RFC822.test189 oneAtSign
            RFC822.test190 oneAtSign
            RFC822.test191 oneAtSign
            RFC822.test192 oneAtSign
            RFC822.test193 oneAtSign
            RFC822.test194 oneAtSign
            RFC822.test195 oneAtSign
            RFC822.test196 oneAtSign
            RFC822.test197 oneAtSign
            RFC822.test198 oneAtSign
            RFC822.test199 oneAtSign
            RFC822.test200 oneAtSign
            RFC822.test201 oneAtSign
            RFC822.test202 oneAtSign
            RFC822.test203 oneAtSign
            RFC822.test204 oneAtSign
            RFC822.test205 oneAtSign
            RFC822.test206 oneAtSign
            RFC822.test207 oneAtSign
            RFC822.test208 oneAtSign
            RFC822.test209 oneAtSign
            RFC822.test210 oneAtSign
            RFC822.test211 oneAtSign
            RFC822.test212 oneAtSign
            RFC822.test213 oneAtSign
            RFC822.test214 oneAtSign
            RFC822.test215 oneAtSign
            RFC822.test216 oneAtSign
            RFC822.test217 oneAtSign
            RFC822.test218 oneAtSign
            RFC822.test219 oneAtSign
            RFC822.test220 oneAtSign
            RFC822.test221 oneAtSign
            RFC822.test222 oneAtSign
            RFC822.test223 oneAtSign
            RFC822.test224 oneAtSign
            RFC822.test225 oneAtSign
            RFC822.test226 oneAtSign
            RFC822.test227 oneAtSign
            RFC822.test228 oneAtSign
            RFC822.test229 oneAtSign
            RFC822.test230 oneAtSign
            RFC822.test231 oneAtSign
            RFC822.test232 oneAtSign
            RFC822.test233 oneAtSign
            RFC822.test234 oneAtSign
            RFC822.test235 oneAtSign
            RFC822.test236 oneAtSign
            RFC822.test237 oneAtSign
            RFC822.test238 oneAtSign
            RFC822.test239 oneAtSign
            RFC822.test240 oneAtSign
            RFC822.test241 oneAtSign
            RFC822.test242 oneAtSign
            RFC822.test243 oneAtSign
            RFC822.test244 oneAtSign
            RFC822.test245 oneAtSign
            RFC822.test246 oneAtSign
            RFC822.test247 oneAtSign
            RFC822.test248 oneAtSign
            RFC822.test249 oneAtSign
            RFC822.test250 oneAtSign
            RFC822.test251 oneAtSign
            RFC822.test252 oneAtSign
            RFC822.test253 oneAtSign
            RFC822.test254 oneAtSign
            RFC822.test255 oneAtSign
            RFC822.test256 oneAtSign
            RFC822.test257 oneAtSign
            RFC822.test258 oneAtSign
            RFC822.test259 oneAtSign
            RFC822.test260 oneAtSign
            RFC822.test261 oneAtSign
            RFC822.test262 oneAtSign
            RFC822.test263 oneAtSign
            RFC822.test264 oneAtSign
            RFC822.test265 oneAtSign
            RFC822.test266 oneAtSign
            RFC822.test267 oneAtSign
            RFC822.test268 oneAtSign
            RFC822.test269 oneAtSign
            RFC822.test270 oneAtSign
            RFC822.test271 oneAtSign
            RFC822.test272 oneAtSign
            RFC822.test273 oneAtSign
            RFC822.test274 oneAtSign
            RFC822.test275 oneAtSign
            RFC822.test276 oneAtSign
            RFC822.test277 oneAtSign
            RFC822.test278 oneAtSign
            RFC822.test279 oneAtSign
            RFC822.test280 oneAtSign
            ]
