示例#1
0
        /// <summary>
        /// Capture requirements related with UserEmailAddress.
        /// </summary>
        /// <param name="userEmailAddress">The UserEmailAddress</param>
        /// <param name="site">Instance of ITestSite</param>
        private static void ValidateUserEmailAddress(string userEmailAddress, ITestSite site)
        {
            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R909
            bool isVerifiedR909 = AdapterHelper.IsValidEmailAddr(userEmailAddress);

            site.Log.Add(
                LogEntryKind.Debug,
                "For requirement MS-FSSHTTP_R909, the format of the e-mail addresses should be as specified in [RFC2822] section 3.4.1, the actual e-mail addresses value is: {0}",
                userEmailAddress);

            site.CaptureRequirementIfIsTrue(
                isVerifiedR909,
                "MS-FSSHTTP",
                909,
                @"[In WhoAmISubResponseDataOptionalAttributes][UserEmailAddress] The format of the email address MUST be as specified in [RFC2822] section 3.4.1.");

            // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R1467
            bool isVerifiedR1467 = AdapterHelper.IsValidEmailAddr(userEmailAddress);

            site.Log.Add(
                LogEntryKind.Debug,
                "For requirement MS-FSSHTTP_R1467, the value format of the userEmailAddress attribute should be as specified in [RFC2822], the actual userEmailAddress value is: {0}",
                userEmailAddress);
            site.CaptureRequirementIfIsTrue(
                isVerifiedR1467,
                "MS-FSSHTTP",
                1467,
                @"[In WhoAmISubResponseDataOptionalAttributes][UserEmailAddress] Format of the e-mail addresses MUST be:
                     
                     addr-spec       =       local-part ""@"" domain
                     
                     
                     
                     local-part      =       dot-atom / quoted-string / obs-local-part
                     
                     domain          =       dot-atom / domain-literal / obs-domain
                     
                     domain-literal  =       [CFWS] ""["" *([FWS] dcontent) [FWS] ""]"" [CFWS]
                     
                     dcontent        =       dtext / quoted-pair
                     
                     dtext           =       NO-WS-CTL /     ; Non white space controls
                     
                                             %d33-90 /       ; The rest of the US-ASCII
                     
                                             %d94-126        ;  characters not including ""["",
                     
                                                             ;  ""]"", or ""\""
                     
                     quoted-pair     =       (""\"" text) / obs-qp
                     
                     text            =       %d1-9 /         ; Characters excluding CR and LF
                     
                                             %d11 /
                     
                                             %d12 /
                     
                                             %d14-127 /
                     
                                             obs-text
                     
                     obs-text        =       *LF *CR *(obs-char *LF *CR)
                     
                     obs-char        =       %d0-9 / %d11 /          ; %d0-127 except CR and
                     
                                             %d12 / %d14-127         ;  LF
                     
                     obs-domain      =       atom *(""."" atom)
                     
                     atom            =       [CFWS] 1*atext [CFWS]
                     
                     atext           =       ALPHA / DIGIT / ; Any character except controls,
                     
                                             ""!"" / ""#"" /     ;  SP, and specials.
                     
                                             ""$"" / ""%"" /     ;  Used for atoms
                     
                                             ""&"" / ""'"" /
                     
                                             ""*"" / ""+"" /
                     
                                             ""-"" / ""/"" /
                     
                                             ""="" / ""?"" /
                     
                                             ""^"" / ""_"" /
                     
                                             ""`"" / ""{"" /
                     
                                             ""|"" / ""}"" /
                     
                                             ""~""
                     
                     dot-atom        =       [CFWS] dot-atom-text [CFWS]
                     
                     dot-atom-text   =       1*atext *(""."" 1*atext)
                     
                     NO-WS-CTL       =       %d1-8 /         ; US-ASCII control characters
                     
                                             %d11 /          ;  that do not include the
                     
                                             %d12 /          ;  carriage return, line feed,
                     
                                             %d14-31 /       ;  and white space characters
                     
                                             %d127");
        }