Skip to content

Commit

Permalink
Ignored signed assertion tests.
Browse files Browse the repository at this point in the history
- See note in issue Sustainsys#137.
- Added support for IgnoreAttribute to RunAllTestWithOtherCultures.
  • Loading branch information
AndersAbel committed Jan 16, 2015
1 parent 41c81b5 commit a2d1567
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Kentor.AuthServices.Tests/AllTestsOtherCultures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ where t.GetCustomAttribute<TestClassAttribute>() != null
m => m.GetCustomAttribute<ClassCleanupAttribute>() != null).SingleOrDefault(),
TestMethods = t.GetMethods().Where(
m => m.GetCustomAttribute<TestMethodAttribute>() != null
&& m.GetCustomAttribute<NotReRunnableAttribute>() == null).ToList()
&& m.GetCustomAttribute<NotReRunnableAttribute>() == null
&& m.GetCustomAttribute<IgnoreAttribute>() == null).ToList()
}).ToList();

// These are the environments I have access to. Please feel free to add and checking whatever
Expand Down
3 changes: 3 additions & 0 deletions Kentor.AuthServices.Tests/Saml2P/Saml2ResponseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ public void Saml2Response_GetClaims_ThrowOnMissingSignatureInResponseAndAnyAsser
}

[TestMethod]
[NotReRunnable]
public void Saml2Response_GetClaims_CorrectSignedResponseMessage()
{
var response =
Expand Down Expand Up @@ -176,6 +177,7 @@ public void Saml2Response_GetClaims_CorrectSignedResponseMessage()
}

[TestMethod]
[Ignore]
public void Saml2Response_GetClaims_CorrectSignedSingleAssertionInResponseMessage()
{
var response =
Expand Down Expand Up @@ -210,6 +212,7 @@ public void Saml2Response_GetClaims_CorrectSignedSingleAssertionInResponseMessag
}

[TestMethod]
[Ignore]
public void Saml2Response_GetClaims_CorrectSignedMultipleAssertionInResponseMessage()
{
var response=
Expand Down
6 changes: 4 additions & 2 deletions Kentor.AuthServices/XmlDocumentExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static class XmlDocumentExtensions
/// Sign an xml document with the supplied cert.
/// </summary>
/// <param name="xmlDocument">XmlDocument to be signed. The signature is
/// added as a node in the document.</param>
/// added as a node in the document, right after the Issuer node.</param>
/// <param name="cert">Certificate to use when signing.</param>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes", MessageId = "System.Xml.XmlNode")]
public static void Sign(this XmlDocument xmlDocument, X509Certificate2 cert)
Expand Down Expand Up @@ -48,7 +48,9 @@ public static void Sign(this XmlDocument xmlDocument, X509Certificate2 cert)
signedXml.AddReference(reference);
signedXml.ComputeSignature();

xmlDocument.DocumentElement.AppendChild(xmlDocument.ImportNode(signedXml.GetXml(), true));
xmlDocument.DocumentElement.InsertAfter(
xmlDocument.ImportNode(signedXml.GetXml(), true),
xmlDocument.DocumentElement["Issuer", Saml2Namespaces.Saml2Name]);
}
}
}

0 comments on commit a2d1567

Please sign in to comment.