Beispiel #1
0
        public void RemoveIndicatorStringValeExpresionEqualmockOk()
        {
            Guid   id    = Guid.NewGuid();
            string color = "red";
            Value  izq   = new StringValue {
                Data = "hola"
            };
            Value der = new StringValue {
                Data = "hola"
            };
            BaseCondition component = new Condition
            {
                ValueIzq = izq,
                ValueDer = der,
                Operator = "="
            };
            Indicator indicator = new Indicator {
                Color     = color,
                Id        = id,
                Condition = component
            };
            var mock = new Mock <IRepository <Indicator> >(MockBehavior.Strict);

            mock.Setup(m => m.Remove(It.IsAny <Indicator>()));
            mock.Setup(m => m.Save());
            IndicatorLogic indicatorLogic = new IndicatorLogic(mock.Object);

            indicatorLogic.Remove(indicator);

            mock.VerifyAll();
        }
Beispiel #2
0
        public void RemoveIndicatorStringValeExpresionEqualNotOk()
        {
            Guid   id    = Guid.NewGuid();
            string color = "red";
            Value  izq   = new StringValue {
                Data = "hola"
            };
            Value der = new StringValue {
                Data = "hola"
            };
            BaseCondition component = new Condition
            {
                ValueIzq = izq,
                ValueDer = der,
                Operator = "="
            };
            Indicator indicator = new Indicator {
                Color     = color,
                Id        = id,
                Condition = component
            };
            var context = ContextFactory.GetMemoryContext(Guid.NewGuid().ToString());
            IRepository <Indicator> indicatorRepo  = new IndicatorRepository(context);
            IndicatorLogic          indicatroLogic = new IndicatorLogic(indicatorRepo);

            indicatroLogic.Remove(indicator);
        }