Пример #1
0
        public void CreateNull()
        {
            Entities.StepsInFields obj = null;
            adaptadorStepsInFields.Setup(item => item.SaveChanges()).Returns(null);
            BusinessRules.Interfaces.IStepsInFields BusinessRulesStepsInFields = new BusinessRules.BusinessRules.StepsInFields(adaptadorStepsInFields.Object);
            var objReturn = BusinessRulesStepsInFields.Create(obj);

            Assert.IsTrue(objReturn == null);
        }
Пример #2
0
        public void Create()
        {
            var obj = new Entities.StepsInFields {
                IdStep = 200
            };

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

            Assert.IsTrue(objReturn != null && objReturn.Value > 0);
        }
Пример #3
0
        public void CreateList()
        {
            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.Create(lst);


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