public void TestLoginUserServiceUpdate() { LoginUser user = new LoginUser() { IsActivated = true, IsAdmin = false, UserInfo = new UserInfo() { Email = "*****@*****.**" }, PasswordHash = new byte[] { 1, 2, 3 }, PasswordSalt = new byte[] { 1, 2, 3 }, Id = 1 }; LoginUser userUpdatedIfo = new LoginUser() { IsActivated = true, IsAdmin = false, UserInfo = new UserInfo() { Email = "*****@*****.**" }, PasswordHash = new byte[] { 1, 2, 3 }, PasswordSalt = new byte[] { 1, 2, 3 }, Id = 1 }; _mockRepo.Setup(x => x.Update(user)).Returns(userUpdatedIfo); _mockRepo.Setup(x => x.Read(user.Id)).Returns(new Queue <LoginUser>(new[] { user, userUpdatedIfo }).Dequeue); Assert.IsTrue(_service.Update(user).Equals(userUpdatedIfo)); _mockRepo.Verify(x => x.Update(user), Times.Once); _mockRepo.Verify(x => x.Read(user.Id), Times.Exactly(2)); }