Пример #1
0
        public void StockDailyTest()
        {
            SetUp(dictionaryAppleDailyString);
            StockDaily appleDaily = new StockDaily(singleData);

            SetUp(dictionaryMicrosoftDailyString);
            StockDaily msDaily = new StockDaily(singleData);

            using (var db = new StockTabelsContext())
            {
                StockDaily temp = db.Daily.Find(appleDaily.Key);
                if (temp != null)
                {
                    db.Daily.Remove(temp);
                }
                db.Daily.Add(appleDaily);
                temp = db.Daily.Find(msDaily.Key);
                if (temp != null)
                {
                    db.Daily.Remove(temp);
                }
                db.Daily.Add(msDaily);
                db.SaveChanges();
            }
        }
Пример #2
0
        public void StockRTTest()
        {
            logger.Info("started RT test");
            SetUp(dictionaryAppleRTString);
            StockRT appleRt = new StockRT(singleData);

            SetUp(dictionaryMicrosoftRTString);
            StockRT msRt = new StockRT(singleData);

            using (var db = new StockTabelsContext())
            {
                StockRT temp = db.RT.Find(appleRt.Key);
                if (temp != null)
                {
                    db.RT.Remove(temp);
                }
                db.RT.Add(appleRt);
                temp = db.RT.Find(msRt.Key);
                if (temp != null)
                {
                    db.RT.Remove(temp);
                }
                db.RT.Add(msRt);
                db.SaveChanges();
            }
        }