FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Remove redundant assertions in tests · dschilling/Saml2@c00a37e · GitHub

forked from Sustainsys/Saml2

Commit c00a37e

Browse files
committed
Remove redundant assertions in tests
- Don't test the same logic in another place - will only cause problems later if that behaviour is ever changed. - Use using instead of namespace qualified names
1 parent 9a6449e commit c00a37e

2 files changed

Lines changed: 3 additions & 11 deletions

File tree

‎Sustainsys.Saml2.AspNetCore2/Saml2Handler.cs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using System.Security.Claims;
1010
using Microsoft.AspNetCore.Http;
1111
using System.Diagnostics.CodeAnalysis;
12+
using Sustainsys.Saml2.Metadata;
1213

1314
namespace Sustainsys.Saml2.AspNetCore2
1415
{
@@ -85,12 +86,11 @@ public async Task ChallengeAsync(AuthenticationProperties properties)
8586

8687
var requestData = context.ToHttpRequestData(null);
8788

88-
89-
Metadata.EntityId entityId = null;
89+
EntityId entityId = null;
9090

9191
if (properties.Items.TryGetValue("idp", out var entityIdString))
9292
{
93-
entityId = new Metadata.EntityId(entityIdString);
93+
entityId = new EntityId(entityIdString);
9494
}
9595

9696
var result = SignInCommand.Run(

‎Tests/AspNetCore2.Tests/Saml2HandlerTests.cs‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,6 @@ public async Task Saml2Handler_ChallengeAsync_RedirectsToSelectedIdp()
145145
response.StatusCode.Should().Be(303);
146146
response.Headers["Location"].Single()
147147
.Should().StartWith("https://idp2.example.com/sso?SAMLRequest=");
148-
149-
var state = new StoredRequestState(StubDataProtector.Unprotect(
150-
HttpRequestData.GetBinaryData(cookieData)));
151-
152-
state.ReturnUrl.OriginalString.Should().Be("https://sp.example.com/LoggedIn");
153-
154-
// Don't dual-store the return-url.
155-
state.RelayData.Values.Should().NotContain("https://sp.example.com/LoggedIn");
156148
}
157149

158150
[TestMethod]

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL