Skip to content

Commit

Permalink
Fixed broken test harness
Browse files Browse the repository at this point in the history
- Added meta test to check that CreateSubjectForMetadataRefresh works
- Added missing key element to test metadata.
  • Loading branch information
AndersAbel committed Oct 23, 2015
1 parent 82c8f45 commit 3e45bed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
9 changes: 9 additions & 0 deletions Kentor.AuthServices.Tests/IdentityProviderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,15 @@ IdentityProvider CreateSubjectForMetadataRefresh()
return new IdentityProvider(config, Options.FromConfiguration.SPOptions);
}

[TestMethod]
public void IdentityProvier_CreateSubjectForMetadataRefresh()
{
// Had problems with the factory method causing exceptions, so this is a
// meta test that ensures that the test harness is working.

this.Invoking(i => i.CreateSubjectForMetadataRefresh()).ShouldNotThrow();
}

[TestMethod]
public void IdentityProvider_Binding_ReloadsMetadataIfNoLongerValid()
{
Expand Down
7 changes: 2 additions & 5 deletions Kentor.AuthServices.Tests/Metadata/MetadataServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,8 @@ static IDictionary<string, string> GetContent()

if (IdpAndFederationShortCacheDurationAvailable)
{
string keyElement = string.Empty;
if (IdpVeryShortCacheDurationIncludeInvalidKey)
{
keyElement = @"<KeyDescriptor use=""signing"">Gibberish</KeyDescriptor>";
}
string keyElement = string.Format(@"<KeyDescriptor use=""signing"">{0}</KeyDescriptor>",
IdpVeryShortCacheDurationIncludeInvalidKey ? "Gibberish" : SignedXmlHelper.KeyInfoXml);

content["/idpMetadataVeryShortCacheDuration"] = string.Format(
@"<EntityDescriptor xmlns=""urn:oasis:names:tc:SAML:2.0:metadata""
Expand Down

0 comments on commit 3e45bed

Please sign in to comment.