Exemplo n.º 1
0
        public void TestUpdateUser()
        {
            ProjectManagerController taskManagerController = new ProjectManagerController();

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

            Assert.IsNotNull(users);
            User   user    = users.Where(t => t.FirstName == "editUser").FirstOrDefault();
            string newName = user.FirstName + "Renamed";

            user.FirstName = newName;
            taskManagerController.UpdateUser(user);
            user = taskManagerController.GetUser(user.UserId);
            Assert.IsTrue(user.FirstName == newName);
        }