Ejemplo n.º 1
0
        public void EditNull()
        {
            Entities.StepsInFields obj = null;
            adaptadorStepsInFields.Setup(item => item.SaveChanges()).Returns(null);
            BusinessRules.Interfaces.IStepsInFields BusinessRulesStepsInFields = new BusinessRules.BusinessRules.StepsInFields(adaptadorStepsInFields.Object);
            var objReturn = BusinessRulesStepsInFields.Edit(obj);

            Assert.IsTrue(objReturn == null);
        }
Ejemplo n.º 2
0
        public void Edit()
        {
            var obj = new Entities.StepsInFields {
                IdStep = 1
            };

            adaptadorStepsInFields.Setup(item => item.SaveChanges()).Returns(1);
            BusinessRules.Interfaces.IStepsInFields BusinessRulesStepsInFields = new BusinessRules.BusinessRules.StepsInFields(adaptadorStepsInFields.Object);
            var objReturn = BusinessRulesStepsInFields.Edit(obj);

            Assert.IsTrue(objReturn != null && objReturn.Value);
        }
Ejemplo n.º 3
0
        public void EditList()
        {
            var lst = new List <Entities.StepsInFields>()
            {
                new Entities.StepsInFields {
                    IdStep = 3
                },
                new Entities.StepsInFields {
                    IdStep = 4
                }
            };

            adaptadorStepsInFields.Setup(item => item.SaveChanges()).Returns(lst.Count);
            BusinessRules.Interfaces.IStepsInFields BusinessRulesStepsInFields = new BusinessRules.BusinessRules.StepsInFields(adaptadorStepsInFields.Object);
            var objReturn = BusinessRulesStepsInFields.Edit(lst);

            Assert.IsTrue(objReturn != null && objReturn.Value);
        }