//Test to add the user public void ShouldAddUser() { var userId = _userList.Count() + 1; var userDetail = new UserEntity { UserId = userId, FirstName = "Subash", LastName = "Mani", EmpId = 101136, UserStatus = "Y", AddDate = new DateTime() }; _mockRepository.AddUser(userDetail); UserEntity addedUser = _mockRepository.GetUser(userId); Assert.IsTrue(_userList.Count() == 6); Assert.IsNotNull(addedUser); Assert.AreSame(addedUser.GetType(), typeof(UserEntity)); Assert.AreEqual(userId, addedUser.UserId); Assert.IsTrue(userDetail.FirstName == addedUser.FirstName); Assert.IsTrue(userDetail.LastName == addedUser.LastName); Assert.IsTrue(userDetail.EmpId == addedUser.EmpId); }
public void AddUser(UserEntity user) { _projDL.AddUser(user); }