Ejemplo n.º 1
0
    public void ExecuteAsync_ThrowsArgumentNullException_WhenHttpContextIsNull()
    {
        // Arrange
        var         result      = new ChallengeHttpResult();
        HttpContext httpContext = null;

        // Act & Assert
        Assert.ThrowsAsync <ArgumentNullException>("httpContext", () => result.ExecuteAsync(httpContext));
    }
Ejemplo n.º 2
0
    public async Task ChallengeResult_ExecuteAsync_NoSchemes()
    {
        // Arrange
        var result      = new ChallengeHttpResult(new string[] { }, null);
        var auth        = new Mock <IAuthenticationService>();
        var httpContext = GetHttpContext(auth);

        // Act
        await result.ExecuteAsync(httpContext);

        // Assert
        auth.Verify(c => c.ChallengeAsync(httpContext, null, null), Times.Exactly(1));
    }