Esempio n. 1
0
        static void Main(string[] args)
        {
            var vipClientId = 25;
            var accountBl   = new AccountBl();

            accountBl.GetInvestmentAccounts(vipClientId, AccountType.Investment);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            var       vipClientId = 25;
            var       accountBl   = new AccountBl();
            DataStore dataStore   = new DataStore();

            accountBl.GetInvestmentAccounts(vipClientId, AccountType.Investment, dataStore);
        }
Esempio n. 3
0
        // GET: TestAjax
        public ActionResult Index()
        {
            var loginDto = new LoginDto()
            {
                Username = "******", Password = "******", CodeToken = "", Code = "", IsRemember = false, RetUrl = string.Empty
            };
            var result = AccountBl.Login(loginDto);

            return(View());
        }
        public void TestGetInvestmentAccounts()
        {
            List <Account> accounts = new List <Account>();
            Account        newAc    = new Account();

            newAc.AccountNumber = "25";
            newAc.AccountOwner  = 25;
            newAc.AccountType   = AccountType.Investment;
            accounts.Add(newAc);

            int vipClientId           = 25;
            Mock <DataStore> objStore = new Mock <DataStore>();

            objStore.Setup(x => x.LoadAccounts(25)).Returns(accounts);
            AccountBl accountBl = new AccountBl();



            List <Account> mockAccounts = accountBl.GetInvestmentAccounts(vipClientId, AccountType.Investment, objStore.Object);

            Assert.AreEqual(mockAccounts[0].AccountOwner, 25);
        }
Esempio n. 5
0
        public void GetInvestmentAccountsTest()
        {
            var        accountBl = new AccountBl();
            IDataStore mds       = new MockDataStore();

            accountBl.setDataStore(mds);
            var actual = (accountBl.GetInvestmentAccounts(25, AccountType.Investment))[0];

            Assert.AreEqual(25, actual.AccountOwner);
            Assert.AreEqual(AccountType.Investment, actual.AccountType);

            var expectedMessage = "Invalid account type provided";

            try
            {
                accountBl.GetInvestmentAccounts(26, AccountType.Checking);
            }
            catch (Exception e)
            {
                Assert.AreEqual(expectedMessage, e.Message);
            }

            try
            {
                accountBl.GetInvestmentAccounts(27, AccountType.Savings);
            }
            catch (Exception e)
            {
                Assert.AreEqual(expectedMessage, e.Message);
            }
            try
            {
                accountBl.GetInvestmentAccounts(28, AccountType.Trading);
            }
            catch (Exception e)
            {
                Assert.AreEqual(expectedMessage, e.Message);
            }
        }
Esempio n. 6
0
    public void GetInvestmentAccountsTest()
    {
        //Arrange
        var clientId     = 25;
        var mockAccounts = new List <Account> {
            new Account {
                AccountNumber = "aaa", AccountOwner = clientId, AccountType = AccountType.Investment
            },
            new Account {
                AccountNumber = "bbb", AccountOwner = clientId, AccountType = AccountType.Savings
            },
            new Account {
                AccountNumber = "ccc", AccountOwner = clientId, AccountType = AccountType.Checking
            },
        };
        var mockDatastore = new Mock <IDataStore>();

        mockDatastore.Setup(_ => _.LoadAccounts(clientId)).Returns(mockAccounts);
        var subject = new AccountBl(mockDatastore.Object);
        //Act
        var accounts = subject.GetInvestmentAccounts(clientId, AccountType.Investment);
        //Assert
        //...
    }
Esempio n. 7
0
 public FacadeController()
 {
     this.Account   = new AccountBl();
     this.Quotation = new QuotationBl();
 }
Esempio n. 8
0
 public AccountController()
 {
     this.Bl = new AccountBl();
 }