Exemplo n.º 1
0
        public async void TestGetItem_Account()
        {
            TradeServiceDAL service = new TradeServiceDAL(this.tableName);

            var accountlist = await service.GetItem(this.id);

            Console.WriteLine("list item details: " + ObjectHelper.ToJson(accountlist));
        }
Exemplo n.º 2
0
        public async void TestGetAll_Accounts()
        {
            TradeServiceDAL service = new TradeServiceDAL(this.tableName);

            var accountlist = await service.GetAll();

            Console.WriteLine("list count: " + accountlist.Count + ObjectHelper.ToJson(accountlist));
        }
Exemplo n.º 3
0
        public async void TestUpdate_Account()
        {
            TradeServiceDAL service = new TradeServiceDAL(this.tableName);

            AccountEntity account = await service.GetItem(this.id);

            account.Trades[0].ExitDate  = 12345;
            account.Trades[0].ExitPrice = 12.345;
            account.Trades[0].PL        = 1.2;

            AccountEntity updateAccount = await service.Update(account);
        }
Exemplo n.º 4
0
        public async void TestInsertNewAccount()
        {
            TradeServiceDAL tradeService = new TradeServiceDAL(tableName);

            await tradeService.InsertNewTrade(new AccountEntity
            {
                Id     = this.id,
                Name   = "test account nae",
                Trades = new List <TradeEntity> {
                    new TradeEntity {
                        Code = "sub", EntryPrice = 123456, EntryDate = 123412321
                    },
                    new TradeEntity {
                        Code = "rio", EntryPrice = 654321, EntryDate = 1, ExitPrice = 1.5, ExitDate = 123, PL = 0.9
                    },
                }
            });
        }
Exemplo n.º 5
0
 public TradeBLL(string tableName)
 {
     this.dal = new TradeServiceDAL(tableName);
 }
Exemplo n.º 6
0
        public async void TestDelete_Account()
        {
            TradeServiceDAL service = new TradeServiceDAL(this.tableName);

            await service.Delete(this.id);
        }