public void When_DeleteUser_Then_VerifyResults()
        {
            var result = controller.DeleteUser(1);

            Assert.NotNull(result);

            result = controller.DeleteUser(0);
            Assert.NotNull(result);
        }
        public void When_DeleteNonExistingUser_Then_NotFoundReceived()
        {
            // Arrange & Act
            var result = Controller.DeleteUser(-1);

            // Assert
            Assert.IsNotNull(result);
            Assert.IsInstanceOf <NotFoundResult>(result);
        }
Exemplo n.º 3
0
        public void DeleteUserTest()
        {
            Users newUser = new Users()
            {
                UserId = 6, EmployeeId = "IT010", FirstName = "Eliss", LastName = "Sturn"
            };
            ProjectManagerController tb = new ProjectManagerController(dbContext.Object);

            tb.AddUser(newUser);

            var result = tb.DeleteUser(6) as OkNegotiatedContentResult <string>;

            Assert.AreEqual(result.Content, "Users Deleted Successfully");
        }
Exemplo n.º 4
0
        public void TestDeleteUser()
        {
            ProjectManagerController taskManagerController = new ProjectManagerController();

            taskManagerController.AddUser(new Models.User()
            {
                FirstName = "TestDelete1", LastName = "Test", EmployeeId = "test"
            });
            IEnumerable <User> users = taskManagerController.GetAllUsers();

            Assert.IsNotNull(users);
            int  userId = users.Where(t => t.FirstName == "TestDelete1").FirstOrDefault().UserId;
            User user   = taskManagerController.GetUser(userId);

            taskManagerController.DeleteUser(userId);
            user = taskManagerController.GetUser(userId);
            Assert.IsNull(user);
        }
Exemplo n.º 5
0
        public void TestWebApiDeleteUser()
        {
            var response = projectObj.DeleteUser(userId);

            Assert.AreEqual(true, response.IsSuccess);
        }
Exemplo n.º 6
0
 public void DeleteUserTest_IterationsMode()
 {
     var result = tb.DeleteUser(6) as OkNegotiatedContentResult <string>;
 }