public void Saml2RequestBase_ReadBasePropertiesWithNullArgument_ShouldThrow() { var subject = new ConcreteSaml2Request(); Action a = () => subject.TestReadBasePropertiesWithNull(); a.ShouldThrow <ArgumentNullException>().And.ParamName.Should().Be("xml"); }
public void Saml2RequestBase_Id_IsUnique() { var r1 = new ConcreteSaml2Request(); var r2 = new ConcreteSaml2Request(); r1.Id.Should().NotBe(r2.Id); }
public void Saml2RequestBase_ToXNodes_IssueInstant() { var r = new ConcreteSaml2Request(); r.ToXElement().Attribute("IssueInstant").Should().NotBeNull() .And.Subject.Value.Should().Be(r.IssueInstant); }
public void Saml2RequestBase_ReadBasePropertiesWithAdditionalExtensionContent_ShouldConvertChildNodes() { var xml = "<saml2p:ConcreteRequest xmlns:saml2p=\"urn:oasis:names:tc:SAML:2.0:protocol\" ID=\"id2ade1f56e9d1443b93216a0466a76e70\" Version=\"2.0\"><saml2p:Extensions><additional /></saml2p:Extensions></saml2p:ConcreteRequest>"; var subject = new ConcreteSaml2Request().TestReadBasePropertiesWith(xml); subject.ExtensionsContent.Should().HaveCount(1); }
public void Saml2RequestBase_Id_IsUnique() { var r1 = new ConcreteSaml2Request(); var r2 = new ConcreteSaml2Request(); r1.Id.Should().NotBe(r2.Id); }
public void Saml2RequestBase_ToXNodes_Version() { var r = new ConcreteSaml2Request(); r.ToXElement().Attribute("Version").Should().NotBeNull() .And.Subject.Value.Should().Be(r.Version); }
public void Saml2RequestBase_ToXNodes_Id() { var r = new ConcreteSaml2Request(); r.ToXElement().Attribute("ID").Should().NotBeNull() .And.Subject.Value.Should().Be(r.Id); }
public void Saml2RequestBase_IssueInstant_Format() { var issueInstant = new ConcreteSaml2Request().IssueInstant; Regex.IsMatch(issueInstant, "20[0-9]{2}-((0[0-9])|(1[0-2]))-(([0-2][0-9])|(3[0-1]))T(([01][0-9])|(2[0-3]))(:[0-5][0-9]){2}Z") .Should().BeTrue(); }
public void Saml2RequestBase_IssueInstant_Format() { var issueInstant = new ConcreteSaml2Request().IssueInstant; Regex.IsMatch(issueInstant, "20[0-9]{2}-((0[0-9])|(1[0-2]))-(([0-2][0-9])|(3[0-1]))T(([01][0-9])|(2[0-3]))(:[0-5][0-9]){2}Z") .Should().BeTrue(); }
public void Saml2RequestBase_IssueInstant_IsNow() { var issueInstant = new ConcreteSaml2Request().IssueInstant; var parsed = DateTime.Parse(issueInstant).ToUniversalTime(); parsed.Should().BeCloseTo(DateTime.UtcNow, 1200); parsed.Kind.Should().Be(DateTimeKind.Utc); }
public void Saml2RequestBase_IssueInstant_IsNow() { var issueInstant = new ConcreteSaml2Request().IssueInstant; var parsed = DateTime.Parse(issueInstant).ToUniversalTime(); parsed.Should().BeCloseTo(DateTime.UtcNow, 1200); parsed.Kind.Should().Be(DateTimeKind.Utc); }
public void Saml2RequestBase_ToXNodes_Extensions() { var content = XElement.Parse("<additional />"); var r = new ConcreteSaml2Request() { ExtensionsContent = new[] { content } }; r.ToXElement().Element(Saml2Namespaces.Saml2P + "Extensions").FirstNode.Should().Be(content); }
public void Saml2RequestBase_ToXNodes_Issuer() { var uri = "http://sp.example.com/"; var r = new ConcreteSaml2Request() { Issuer = new EntityId(uri) }; r.ToXElement().Element(Saml2Namespaces.Saml2 + "Issuer").Value.Should().Be(uri); }
public void Saml2RequestBase_ToXNodes_Destination() { var uri = "http://idp.example.com/"; var r = new ConcreteSaml2Request() { DestinationUrl = new Uri(uri) }; r.ToXElement().Attribute("Destination").Should().NotBeNull() .And.Subject.Value.Should().Be(uri); }
public void Saml2RequestBase_Id_IsValidXsId() { var id = new ConcreteSaml2Request().Id; Regex.IsMatch(id, "[^:0-9][^:]*").Should().BeTrue(); }
public void Saml2RequestBase_ReadBasePropertiesWithNullArgument_ShouldThrow() { var subject = new ConcreteSaml2Request(); Action a = () => subject.TestReadBasePropertiesWithNull(); a.ShouldThrow<ArgumentNullException>().And.ParamName.Should().Be("xml"); }
public void Saml2RequestBase_ToXNodes_Saml2NamespacePrefix() { var r = new ConcreteSaml2Request(); r.ToXElement().GetPrefixOfNamespace(Saml2Namespaces.Saml2Name).Should().Be("saml2"); }
public void Saml2RequestBase_MessageName() { var subject = new ConcreteSaml2Request(); subject.MessageName.Should().Be("SAMLRequest"); }
public void Saml2RequestBase_ToXNodes_Issuer() { var uri = "http://sp.example.com/"; var r = new ConcreteSaml2Request() { Issuer = new EntityId(uri) }; r.ToXElement().Element(Saml2Namespaces.Saml2+ "Issuer").Value.Should().Be(uri); }
public void Saml2RequestBase_ToXNodes_Destination() { var uri = "http://idp.example.com/"; var r = new ConcreteSaml2Request() { DestinationUrl = new Uri(uri) }; r.ToXElement().Attribute("Destination").Should().NotBeNull() .And.Subject.Value.Should().Be(uri); }
public void Saml2RequestBase_ToXNodes_Saml2NamespacePrefix() { var r = new ConcreteSaml2Request(); r.ToXElement().GetPrefixOfNamespace(Saml2Namespaces.Saml2Name).Should().Be("saml2"); }
public void Saml2RequestBase_MessageName() { var subject = new ConcreteSaml2Request(); subject.MessageName.Should().Be("SAMLRequest"); }
public void Saml2RequestBase_Id_IsValidXsId() { var id = new ConcreteSaml2Request().Id; Regex.IsMatch(id, "[^:0-9][^:]*").Should().BeTrue(); }