Tests/Identity.Api.Tests/Controllers/UsersControllerTests.cs
/// <summary>
/// Given null request
/// When unassigning user from a role
/// Return bad request
/// </summary>
Given null request
When unassigning user from a role
Return bad request
Given null request When unassigning user from a role Return bad request
[Fact]
        public async Task UnassignRoleToUserAsync_NullRequest_ReturnBadRequest()
        {
            UserRoleAssignmentRequest request = null;
            BadRequestObjectResult result = await _usersController.UnassignRoleToUserAsync(request).ConfigureAwait(false)
                as BadRequestObjectResult;
            Assert.NotNull(result);
            ResultMessage objectResult = result.Value as ResultMessage;
            Assert.False(objectResult.OperationStatus);
            Assert.Equal(MessageResources.RoleUnassignmentRequestEmpty, objectResult.ErrorMessages.First());
        }
[ Fact ] public async Task UnassignRoleToUserAsync_NullRequest_ReturnBadRequest ( ) { UserRoleAssignmentRequest request = null ; BadRequestObjectResult result = await _usersController . UnassignRoleToUserAsync ( request ) . ConfigureAwait ( false ) as BadRequestObjectResult ; Assert . NotNull ( result ) ; ResultMessage objectResult = result . Value as ResultMessage ; Assert . False ( objectResult . OperationStatus ) ; Assert . Equal ( MessageResources . RoleUnassignmentRequestEmpty , objectResult . ErrorMessages . First ( ) ) ; }
Given null request
When unassigning user from a role
Return bad request
Given null request When unassigning user from a role Return bad request
// Arrange // Act // Assert