Exemplo n.º 1
0
        public async Task UpdateUserRoles_returns_string_when_updatedroles_is_null()
        {
            //Arrange
            var controller = new RolesController(_configuration, _contextAccessor);

            //Act
            var result = await controller.UpdateUserRoles(null);

            //Assert
            var messageResult = Assert.IsType <string>(result);                                 //Asserting that the return is a String

            Assert.Contains("Roles to associate with the user cannot be empty", messageResult); //Asserting that message is equal as mentioned
        }
Exemplo n.º 2
0
        public async Task UpdateUserRoles_returns_string_when_updatedroles_count_is_zero()
        {
            //Arrange
            var         controller   = new RolesController(_bosAuthClient);
            List <Role> updatedRoles = new List <Role>();

            //Act
            var result = await controller.UpdateUserRoles(updatedRoles);

            //Assert
            var messageResult = Assert.IsType <string>(result);                                 //Asserting that the return is a String

            Assert.Contains("Roles to associate with the user cannot be empty", messageResult); //Asserting that message is equal as mentioned
        }