Esempio n. 1
0
        public void ChangeUserAccount_CheckAccountNumber_Successful()
        {
            var user     = (IUser)userManager.GetClientById(new Guid("00000000-0000-0000-0000-400000000003"));
            var account1 = new Account(DateTime.Now, null, 200);

            account1.AccountNumber = 55;
            account1.Id            = new Guid("00000000-0000-0000-0000-900000000001");
            var account2 = new Account(DateTime.Now, null, 300);

            account2.AccountNumber = 77;
            account2.Id            = new Guid("00000000-0000-0000-0000-900000000002");
            user.Accounts          = new List <IAccount>()
            {
                account1, account2
            };

            var account3 = new Account(DateTime.Now, null, 200);

            account3.Id            = new Guid("00000000-0000-0000-0000-900000000001");
            account3.AccountNumber = 11;
            var account4 = new Account(DateTime.Now, null, 100);

            account4.Id            = new Guid("00000000-0000-0000-0000-900000000002");
            account4.AccountNumber = 23;

            userManager.ChangeUserAccount(user, new List <IAccount>()
            {
                account3, account4
            });

            var expectedAccountId = 11;

            Assert.AreEqual(expectedAccountId, user.Accounts[0].AccountNumber);
        }