Created
March 14, 2023 04:26
-
-
Save ericmaino/b5735dda5859fe83f160e60a4a0c7b86 to your computer and use it in GitHub Desktop.
Adatper Tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface UserRepository { | |
UserId save(User u); | |
User getUserById(UserId id); | |
void deleteUser(User u); | |
} | |
public UserRepositoryTests { | |
UserRepository users; | |
UserOracle oracle; | |
public deleteUserTest() { | |
User user = oracle.getValidUser(); | |
users.deleteUser(u); | |
assertThat(users.getUserById(user.id)).is().null() | |
} | |
public deleteUserTest() { | |
User newUser = oracle.newUser(); | |
UserId newUserId = users.saveUser(newUser); | |
assertThat(users.getUserById(newUser)).is().null() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment