Exemplo n.º 1
0
        public void CreateNull()
        {
            Entities.TypeFields obj = null;
            adaptadorTypeFields.Setup(item => item.SaveChanges()).Returns(null);
            BusinessRules.Interfaces.ITypeFields BusinessRulesTypeFields = new BusinessRules.BusinessRules.TypeFields(adaptadorTypeFields.Object);
            var objReturn = BusinessRulesTypeFields.Create(obj);

            Assert.IsTrue(objReturn == null);
        }
Exemplo n.º 2
0
        public void Create()
        {
            var obj = new Entities.TypeFields
            {
                Id = 200,

                Name = "Object"
            };

            adaptadorTypeFields.Setup(item => item.SaveChanges()).Returns(1);
            BusinessRules.Interfaces.ITypeFields BusinessRulesTypeFields = new BusinessRules.BusinessRules.TypeFields(adaptadorTypeFields.Object);
            var objReturn = BusinessRulesTypeFields.Create(obj);

            Assert.IsTrue(objReturn != null && objReturn.Value > 0);
        }
Exemplo n.º 3
0
        public void CreateList()
        {
            var lst = new List <Entities.TypeFields>()
            {
                new Entities.TypeFields {
                    Id = 3
                },
                new Entities.TypeFields {
                    Id = 4
                }
            };

            adaptadorTypeFields.Setup(item => item.SaveChanges()).Returns(lst.Count);
            BusinessRules.Interfaces.ITypeFields BusinessRulesTypeFields = new BusinessRules.BusinessRules.TypeFields(adaptadorTypeFields.Object);
            var objReturn = BusinessRulesTypeFields.Create(lst);

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