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