public void CreateUser_UserOrPasswordMissing_CallbackError(string username, string password) { CreateUserInteractorImpl interactor = new CreateUserInteractorImpl(mockExecutor.Object, mainThread, mockCallback.Object, mockRepository.Object, username, password); interactor.Run(); mockCallback.Verify(c => c.OnError(It.Is <string>(s => true)), Times.Once); }
public void CreateUser_ValidUserAndPassword_CallRepoAndCallbackSuccess(string username, string password) { CreateUserInteractorImpl interactor = new CreateUserInteractorImpl(mockExecutor.Object, mainThread, mockCallback.Object, mockRepository.Object, username, password); interactor.Run(); mockRepository.Verify(r => r.Create(It.Is <User>(u => u.Username == username && u.Password == password)), Times.Once()); mockCallback.Verify(c => c.OnUserCreated(It.Is <User>(u => u.Username == username && u.Password == password)), Times.Once); }
public void CreateUser(string username, string password) { CreateUserInteractor createUserInteractor = new CreateUserInteractorImpl(executor, mainThread, this, userRepository, username, password); createUserInteractor.Execute(); }