public void AddAccountNumber_WrongAccessToken_ReturnsFalse()
        {
            var account = new WcfBankingService.Accounts.Account(new AccountNumber("122222", "11", "1"),
                                                                 new Balance(123));

            _userManager.AddAccount(Login, "nie wow", account);
        }
        public void AddAccountNumber_WrongLogin_ReturnsFalse()
        {
            var account = new WcfBankingService.Accounts.Account(new AccountNumber("122222", "11", "1"),
                                                                 new Balance(123));
            var accessToken = _userManager.SignIn(Login, Password);

            Assert.IsNotNull(accessToken);
            Assert.IsFalse(_userManager.AddAccount("Wow", accessToken, account));
        }
        public void AddAccountNumber_NewNumber_ReturnsTrue()
        {
            var accountNumber = new AccountNumber("122222", "11", "1");
            var account       = new WcfBankingService.Accounts.Account(accountNumber, new Balance(123));
            var accessToken   = _userManager.SignIn(Login, Password);

            Assert.IsNotNull(accessToken);
            Assert.IsTrue(_userManager.AddAccount(Login, accessToken, account));
            var searchedAccount = _userManager.GetAccount(accessToken, accountNumber);

            Assert.IsNotNull(searchedAccount);
            Assert.AreEqual(account, searchedAccount);
        }
        public UserManagerTest()
        {
            var hashedPassword = new StandardPasswordHasher().HashPassword(Password);

            IUser user = new WcfBankingService.Users.User(Login, hashedPassword);

            _accessToken = user.GenerateAccessToken(Password);
            Assert.IsNotNull(_accessToken);

            _accountNumber = new AccountNumber("12345678", "1234567891234321", "12");
            IAccount account = new WcfBankingService.Accounts.Account(_accountNumber, new Balance(122m));

            Assert.IsTrue(user.AddAccount(_accessToken, account));

            var userList = new List <IUser>
            {
                user
            };

            _userManager = new UserManager(new MockDataProvider(userList));
        }