Beispiel #1
0
 public void getAllIndicatorsNotOk()
 {
     var context = ContextFactory.GetMemoryContext(Guid.NewGuid().ToString());
     IRepository <Indicator> indicatorRepo = new IndicatorRepository(context);
     var       id         = Guid.NewGuid();
     Indicator indicators = indicatorRepo.Get(id);
 }
Beispiel #2
0
        public void GetIndicatorByIdOK()
        {
            string contextName = Guid.NewGuid().ToString();
            var    context     = ContextFactory.GetMemoryContext(contextName);
            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();

            context       = ContextFactory.GetMemoryContext(contextName);
            indicatorRepo = new IndicatorRepository(context);
            Indicator obtainedIndicator = indicatorRepo.Get(id);

            Assert.AreEqual(obtainedIndicator.Id, indicator.Id);
        }