public SignUpViewModel(ISafeProviderForNonExistingUser safeProviderForNonExistingUser, Action <ISafe, string> signUpCompletionCallback) { _safeProviderForNonExistingUser = safeProviderForNonExistingUser; _signUpCompletionCallback = signUpCompletionCallback; SignUpCommand = new DelegateCommand(SignUp, () => _canSignUp); }
public void SetUp() { SafeProviderForNonExistingUser = CreateSafeProviderForNonExistingUser(); SignUpViewModel = new SignUpViewModel(SafeProviderForNonExistingUser, (safe, userName) => { }); CommandObserver = SignUpViewModel.SignUpCommand.GetDelegateCommandObserver(); ErrorMessagePropertyObserver = SignUpViewModel.GetPropertyObserver <string>(nameof(SignUpViewModel.SignUpErrorMessage)); }
public static void StubPasswordNameValidity(this ISafeProviderForNonExistingUser safeProvider, string password, bool expectedValue, string expectedErrorMessage) { // ReSharper disable once RedundantAssignment string errorMessage = string.Empty; safeProvider.IsPasswordValidForNonExistingUser(password, out errorMessage).Returns(x => { x[1] = expectedErrorMessage; return(expectedValue); }); }