Tests/Identity.Infrastructure.Tests/Services/IdentityServiceTests.cs
/// <summary>
/// Given request is null
/// When authenticating user
/// Throw <see cref="ArgumentNullException"/> exception
/// </summary>
Given request is null
When authenticating user
Throw  exception
Given request is null When authenticating user Throw exception
[Fact]
        public async Task AuthenticateUserAsync_GivenNullRequest_ThrowException()
        {
            ArgumentNullException exception = await Assert.ThrowsAsync<ArgumentNullException>(() => _identityService.AuthenticateUserAsync(null)).ConfigureAwait(false);
            Assert.Equal(string.Format(ErrorMessages.NullExceptionMessage, "request"), exception.Message);
        }
[ Fact ] public async Task AuthenticateUserAsync_GivenNullRequest_ThrowException ( ) { ArgumentNullException exception = await Assert . ThrowsAsync < ArgumentNullException > ( ( ) => _identityService . AuthenticateUserAsync ( null ) ) . ConfigureAwait ( false ) ; Assert . Equal ( string . Format ( ErrorMessages . NullExceptionMessage , " " ) , exception . Message ) ; }
Given request is null
When authenticating user
Throw  exception
Given request is null When authenticating user Throw exception
// Arrange + Act + Assert