Tests/Identity.Infrastructure.Tests/Services/IdentityServiceTests.cs
/// <summary>
/// Given null request
/// when unassigning a user from a role
/// throw <see cref="ArgumentNullException"/> exception
/// </summary>
Given null request
when unassigning a user from a role
throw  exception
Given null request when unassigning a user from a role throw exception
[Fact]
        public async Task UnassignRoleToUserAsync_RequestNotNull_AdminRole_ThrowArgumentNullException()
        {
            UserRoleAssignmentRequest request = new UserRoleAssignmentRequest
            {
                Login = "skinner",
                RoleName = "ADMINISTRATOR"
            };
            ResultMessage result = await _identityService.UnassignRoleToUserAsync(request).ConfigureAwait(false);
            Assert.NotNull(result);
            Assert.False(result.OperationStatus);
            Assert.Equal(MessageResources.UnassignAdminRole,
                result.ErrorMessages.First());
        }
[ Fact ] public async Task UnassignRoleToUserAsync_RequestNotNull_AdminRole_ThrowArgumentNullException ( ) { UserRoleAssignmentRequest request = new UserRoleAssignmentRequest { Login = " " , RoleName = " " } ; ResultMessage result = await _identityService . UnassignRoleToUserAsync ( request ) . ConfigureAwait ( false ) ; Assert . NotNull ( result ) ; Assert . False ( result . OperationStatus ) ; Assert . Equal ( MessageResources . UnassignAdminRole , result . ErrorMessages . First ( ) ) ; }
Given null request
when unassigning a user from a role
throw  exception
Given null request when unassigning a user from a role throw exception
// Arrange // Act // Assert