Exemplo n.º 1
0
        public static void StubCreateSafeForExistingUser(this ISafeProviderForExistingUser safeProvider, string validUserName, string validPassword, ISafe safe)
        {
            ISafe outSafe;

            safeProvider.TryCreateSafeForExistingUser(validUserName, validPassword, out outSafe)
            .Returns(x =>
            {
                x[2] = safe;
                return(true);
            });
        }
        public SignInViewModel(ISafeProviderForExistingUser safeProviderForExistingUser,
                               Action <ISafe, string> signUpCompletionCallback)
        {
            _safeProviderForExistingUser = safeProviderForExistingUser;
            _signUpCompletionCallback    = signUpCompletionCallback;

            AvailableUserNames = _safeProviderForExistingUser.GetUserNames().ToList();
            IsEnabled          = AvailableUserNames.Count != 0;
            if (IsEnabled)
            {
                _signInUserName = AvailableUserNames.ElementAt(0);
            }
            SignInCommand = new DelegateCommand(SignIn, CanSignIn);
        }
 public void SetUp()
 {
     _safeProviderForExistingUser = Substitute.For <ISafeProviderForExistingUser>();
 }