public async Task ShowClaimsWithMissingClaimsShouldRedirectToLogin() { var browser = Web.Browser <TestStartup>(); var peter = Actor.Named("Peter").CanUse(browser); await Given.That(peter).CouldGoToPage(Uris.Claims).Successfully(); peter.UsingBrowser().Should().HaveStatusCode(HttpStatusCode.Redirect); }
public async Task ShowClaimsShouldReturnFakeClaims() { var principal = TestPrincipals.FullClaimsPrincipal; Assert.True(principal.Identity.IsAuthenticated); var claimStrings = principal.Claims.Select(item => $"ClaimType = {item.Type}, Value = {item.Value}"); var browser = Web.Browser <TestStartup>() .WithFakeClaimsPrincipal(principal); var peter = Actor.Named("Peter").CanUse(browser); await Given.That(peter).CouldGoToPage(Uris.Claims).Successfully(); peter.UsingBrowser().Should().HaveStatusCode(HttpStatusCode.OK) .And().Should().HaveContentsWith("tr>td", claimStrings.ToArray()); }