/// <summary>
        /// Capture requirements for Scope structure
        /// </summary>
        /// <param name="scopes">Scope structure</param>
        /// <param name="site">A instance of ITestSite.</param>
        public static void CaptureScopesElementRequirements(ScopesType scopes, ITestSite site)
        {
            // Add debug info
            site.Log.Add(LogEntryKind.Debug, "Scopes: {0}", scopes);

            site.CaptureRequirementIfIsNotNull(
                scopes,
                55,
                @"[In Scopes] Each element in the list is actually a UTF-8-encoded string representation of
                the HoHoDk value in hexBinary format [XMLSCHEMA1.1/2] [and represents one segment].");

            // Add debug info
            site.Log.Add(LogEntryKind.Debug, "Scopes: {0}", scopes);
            site.CaptureRequirementIfIsTrue(
                scopes.Text.Length > 0,
                158,
                @"[The <Scopes> element represents the list of discovery provider scopes, where]
                each element in the list is a string.");
        }
        /// <summary>
        /// Capture requirements related to Scope structure
        /// </summary>
        /// <param name="scopes">Scope structure</param>
        private void CaptureClientRoleScopesElementRequirements(ScopesType scopes)
        {
            // Since the message parsed by stack layer properly, capture the requirement directly.
            Site.CaptureRequirement(
                53,
                @"[In Scopes] When specified in the request message, the peer MUST populate this value[Scopes]
                to indicate the segments it is searching for.");

            // Assume R174 is satisfied
            bool isR174Verified = true;
            foreach (string scope in scopes.Text)
            {
                // Add debug info.
                Site.Log.Add(TestTools.LogEntryKind.Debug, "scope: {0}", scope);
                if (null == scope)
                {
                    // The scope is not absolute uri, hence R174 is not satisfied
                    isR174Verified = false;
                    break;
                }
            }

            Site.CaptureRequirementIfIsTrue(
                isR174Verified,
                174,
                "Scopes MUST be a list of absolute URIs.");

            // "http://schemas.xmlsoap.org/ws/2005/04/discovery/strcmp0" is the case-sensitive
            // string comparison rule defined in Ws-Discovery
            Site.CaptureRequirementIfAreEqual<string>(
                "http://schemas.xmlsoap.org/ws/2005/04/discovery/strcmp0",
                scopes.MatchBy,
                57,
                @"[In Scopes] The Discovery Protocol uses the case-sensitive string comparison rule defined
                as part of the WSD standard schemas.");
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProbeType"/> class
 /// </summary>
 /// <param name="types">Probe types</param>
 /// <param name="scopes">Scopes type</param>
 /// <param name="matchBy">Match by</param>
 public ProbeType(string types, string[] scopes, string matchBy)
 {
     this.typesField  = types;
     this.scopesField = new ScopesType(scopes, matchBy);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProbeType"/> class without parameter
 /// </summary>
 public ProbeType()
 {
     this.scopesField = null;
     this.typesField  = null;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProbeType"/> class
 /// </summary>
 /// <param name="types">Probe types</param>
 /// <param name="scopes">Scopes type</param>
 /// <param name="matchBy">Match by</param>
 public ProbeType(string types, string[] scopes, string matchBy)
 {
     this.typesField = types;
     this.scopesField = new ScopesType(scopes, matchBy);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProbeType"/> class without parameter
 /// </summary>
 public ProbeType()
 {
     this.scopesField = null;
     this.typesField = null;
 }