public void DeteUser_Should_Delete_ApropriateUser() { // Arrange var repository = new TestUserRepository(); var userToDelete = repository.GetUser(1); // Act repository.DeleteUser(userToDelete); var userDeleted = repository.GetUser(1); // Assert Assert.AreEqual(repository.GetAllUsers().Count(), 14); Assert.IsNull(userDeleted); }
public void DeteUser_Should_ThrowExceptionFor_InvalidUser() { // Arrange var repository = new TestUserRepository(); var userToDelete = new User() { UserID = 22 }; // Act try { repository.DeleteUser(userToDelete); Assert.Fail(); } catch (Exception ex) {} }