Ejemplo n.º 1
0
        public void RemoveIndicatorNotExist()
        {
            var context = ContextFactory.GetMemoryContext(Guid.NewGuid().ToString());
            IRepository <Indicator> indicatorRepo = new IndicatorRepository(context);
            var           id        = Guid.NewGuid();
            string        color     = "red";
            BaseCondition component = new Condition();
            Indicator     indicator = new Indicator();

            indicator.Id        = id;
            indicator.Color     = color;
            indicator.Condition = component;
            indicatorRepo.Remove(indicator);
            indicatorRepo.Save();
        }
Ejemplo n.º 2
0
        public void RemoveIndicatorOK()
        {
            var context = ContextFactory.GetMemoryContext(Guid.NewGuid().ToString());
            IRepository <Indicator> indicatorRepo = new IndicatorRepository(context);
            var           id        = Guid.NewGuid();
            string        color     = "red";
            BaseCondition component = new Condition();
            Indicator     indicator = new Indicator();

            indicator.Id        = id;
            indicator.Color     = color;
            indicator.Condition = component;
            indicatorRepo.Add(indicator);
            indicatorRepo.Save();
            indicatorRepo.Remove(indicator);
            indicatorRepo.Save();
            var indicators = indicatorRepo.GetAll().ToList();

            Assert.AreEqual(indicators.Count, 0);
        }