public void ThrowsExceptionWhenKeyInfoConfirmationDataHasNoElements()
            {
                // Arrange
                var subjectConfirmationData = new KeyInfoConfirmationData { Recipient = "urn:wellformed.uri:ok" };
                var validator = new Saml20SubjectConfirmationDataValidator();

                // Act
                validator.ValidateSubjectConfirmationData(subjectConfirmationData);
            }
            public void ThrowsExceptionWhenKeyInfoConfirmationDataHasNoElementsWithCorrectNamespace()
            {
                // Arrange
                var subjectConfirmationData = new KeyInfoConfirmationData();
                subjectConfirmationData.Recipient = "urn:wellformed.uri:ok";
                var doc = new XmlDocument();
                subjectConfirmationData.AnyElements = new[] { doc.CreateElement("ds", "KeyInfo", "http://wrongNameSpace.uri") };

                var validator = new Saml20SubjectConfirmationDataValidator();

                // Act
                validator.ValidateSubjectConfirmationData(subjectConfirmationData);
            }
            public void ThrowsExceptionWhenKeyInfoConfirmationDataHasNoElementsWithValidKeyName()
            {
                // Arrange
                var subjectConfirmationData = new KeyInfoConfirmationData { Recipient = "urn:wellformed.uri:ok" };
                var doc = new XmlDocument();
                var elem = doc.CreateElement("ds", "KeyInfo", "http://wrongNameSpace.uri");
                elem.AppendChild(doc.CreateElement("ds", "KeyName", Saml20Constants.Xmldsig));

                subjectConfirmationData.AnyElements = new[] { elem };

                var validator = new Saml20SubjectConfirmationDataValidator();

                // Act
                validator.ValidateSubjectConfirmationData(subjectConfirmationData);
            }
            public void ThrowsExceptionWhenKeyInfoConfirmationDataSubElementHasNoChildren()
            {
                // Arrange
                var subjectConfirmationData = new KeyInfoConfirmationData { Recipient = "urn:wellformed.uri:ok" };
                var doc = new XmlDocument();
                subjectConfirmationData.AnyElements = new[] { doc.CreateElement("ds", "KeyInfo", Saml20Constants.Xmldsig) };

                var validator = new Saml20SubjectConfirmationDataValidator();

                // Act
                validator.ValidateSubjectConfirmationData(subjectConfirmationData);
            }
            public void ValidatesKeyInfoConfirmationData()
            {
                // Arrange
                var subjectConfirmationData = new KeyInfoConfirmationData { Recipient = "urn:wellformed.uri:ok" };
                var doc = new XmlDocument();
                var elem = doc.CreateElement("ds", "KeyInfo", Saml20Constants.Xmldsig);
                elem.AppendChild(doc.CreateElement("lalala"));

                subjectConfirmationData.AnyElements = new[] { elem };

                var validator = new Saml20SubjectConfirmationDataValidator();

                // Act
                validator.ValidateSubjectConfirmationData(subjectConfirmationData);
            }