Tests/Identity.Infrastructure.Tests/Services/IdentityServiceTests.cs
/// <summary>
/// Given a request is null
/// when creating new user
/// throw <see cref="ArgumentNullException"/> exception
/// </summary>
Given a request is null
when creating new user
throw  exception
Given a request is null when creating new user throw exception
[Fact]
        public async Task CreateUserAsync_GivenRequestIsNull_ThrowArgumentNullException()
        {
            UserCreationRequest request = null;
            ArgumentNullException exception = 
                await Assert.ThrowsAsync<ArgumentNullException>(() => _identityService.CreateUserAsync(request))
                .ConfigureAwait(false);
            Assert.NotNull(exception);
            Assert.Equal(string.Format(ErrorMessages.NullExceptionMessage, "request"), exception.Message);
        }
[ Fact ] public async Task CreateUserAsync_GivenRequestIsNull_ThrowArgumentNullException ( ) { UserCreationRequest request = null ; ArgumentNullException exception = await Assert . ThrowsAsync < ArgumentNullException > ( ( ) => _identityService . CreateUserAsync ( request ) ) . ConfigureAwait ( false ) ; Assert . NotNull ( exception ) ; Assert . Equal ( string . Format ( ErrorMessages . NullExceptionMessage , " " ) , exception . Message ) ; }
Given a request is null
when creating new user
throw  exception
Given a request is null when creating new user throw exception
// Arrange // Act + Assert