public void ThrowsWhenSessionIndexElementIsNotPresent() { // Arrange var validator = new DKSaml20StatementValidator(); var saml20Assertion = AssertionUtil.GetBasicAssertion(); var authnStatement = (AuthnStatement)Array.Find(saml20Assertion.Items, stmnt => stmnt is AuthnStatement); authnStatement.SessionIndex = null; // Act validator.ValidateStatement(authnStatement); }
public void ThrowsExceptionWhenAttributeStatementIsEncrypted() { // Arrange var validator = new DKSaml20StatementValidator(); var saml20Assertion = AssertionUtil.GetBasicAssertion(); var statements = new List <StatementAbstract>(saml20Assertion.Items); var sas = GetAttributeStatement(statements); var attributes = new List <object>(sas.Items); var ee = new EncryptedElement { EncryptedData = new EncryptedData { Type = Saml20Constants.Xenc + "Element" } }; attributes.Add(ee); sas.Items = attributes.ToArray(); // Act validator.ValidateStatement(sas); }