Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Unit Test Example for Medium
public class AccountCreatorTest{
private IAccountChecker _accountCheckerMock;
private IAccountRepository _accountRepositoryMock;
public void Initialize(){
_accountCheckerMock = new AccountCheckerMock();
_accountRepositoryMock = new AccountRepositoryMock();
private class AccountCheckerMock: IAccountChecker{
public bool Exists(){ return true; }
private class AccountRepositoryMock: IAccountRepository{
public void Create(){}
public void TestUsernameIsNotEmpty(){
var accountInfo = new AccountInfo() {UserName="Test"};
var accountCreator = new AccountCreator(_accountChecker, _accountRepository);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.