Esempio n. 1
0
        public void SyncAccountDataAsync_accounts_sameAccount()
        {
            IAccountDA         accountDA = new AccountDAMock();
            SyncPipeServerMock sps       = new SyncPipeServerMock();
            IInstrumDA         instrumDA = new InstrumDAMock();
            IReplicationBL     replBL    = new ReplicationBLMock();

            ImportLeech import = new ImportLeech(instrumDA, accountDA, null, null, replBL);

            import.SyncAccountDataAsync(sps).Wait();

            var r_accounts = sps.GetAccountList().Result;

            CompareAccounts(r_accounts, accountDA.GetAccounts(), replBL);

            // изменим account
            r_accounts[0].Code          = "***";
            r_accounts[0].Name          = "+++";
            r_accounts[0].IsShortEnable = !r_accounts[0].IsShortEnable;
            r_accounts[0].CommPerc     += 0.5m;

            import.SyncAccountDataAsync(sps).Wait();

            CompareAccounts(r_accounts, accountDA.GetAccounts(), replBL);

            // добавим еще account
            sps.AddAccount(Common.Data.AccountTypes.Test, "ccc", "nnn", 0, false);

            import.SyncAccountDataAsync(sps).Wait();

            CompareAccounts(sps.GetAccountList().Result, accountDA.GetAccounts(), replBL);

            // удаление account не тестируем
        }