﻿namespace Email.Tests

open Expecto
open FsRegEx

module ModerateEmail =

    [<Literal>]
    /// C# regex from http://emailregex.com/
//    let ModerateEmailRegex = """[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?"""
    let ModerateEmailRegex = """^(?(")(".+?(?<!\\)"@)|(([0-9a-z]((\.(?!\.))|[-!#\$%&'\*\+/=\?\^`\{\}\|~\w])*)(?<=[0-9a-z])@))(?(\[)(\[(\d{1,3}\.){3}\d{1,3}\])|(([0-9a-z][-\w]*[0-9a-z]*\.)+[a-z0-9][\-a-z0-9]{0,22}[a-z0-9]))$"""
    let moderateEmailRegex = new FsRegEx(ModerateEmailRegex)

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