Beispiel #1
0
        public void WsTrust2005AddressExtractionTest()
        {
            // Arrange
            string responseBody = File.ReadAllText(ResourceHelper.GetTestResourceRelativePath("TestMex2005.xml"));

            Assert.IsFalse(string.IsNullOrWhiteSpace(responseBody));

            // Act
            var mexDocument     = new MexDocument(responseBody);
            var wsTrustEndpoint = mexDocument.GetWsTrustWindowsTransportEndpoint();

            // Assert
            Assert.AreEqual(
                "https://sts.usystech.net/adfs/services/trust/2005/windowstransport",
                wsTrustEndpoint.Uri.AbsoluteUri);
            Assert.AreEqual(wsTrustEndpoint.Version, WsTrustVersion.WsTrust2005);

            // Act
            wsTrustEndpoint = mexDocument.GetWsTrustUsernamePasswordEndpoint();

            // Assert
            Assert.AreEqual("https://sts.usystech.net/adfs/services/trust/2005/usernamemixed", wsTrustEndpoint.Uri.AbsoluteUri);
            Assert.AreEqual(wsTrustEndpoint.Version, WsTrustVersion.WsTrust2005);
        }
Beispiel #2
0
 public void MexEndpointFailsToParseTest()
 {
     var mexDocument = new MexDocument("malformed, non-xml content");
 }