Beispiel #1
0
        public void SearchNull()
        {
            BusinessRules.Interfaces.IFieldsByUser BusinessRulesFieldsByUser = new BusinessRules.BusinessRules.FieldsByUser(adaptadorFieldsByUser.Object);
            var objReturn = BusinessRulesFieldsByUser.Search(null);

            Assert.IsTrue(objReturn == null);
        }
Beispiel #2
0
        public void SearchInclude()
        {
            BusinessRules.Interfaces.IFieldsByUser BusinessRulesFieldsByUser = new BusinessRules.BusinessRules.FieldsByUser(adaptadorFieldsByUser.Object);
            var objReturn = BusinessRulesFieldsByUser.Search(x => x.IdField == 1, null);

            Assert.IsTrue(objReturn != null);
        }
Beispiel #3
0
        public void CountDefault()
        {
            BusinessRules.Interfaces.IFieldsByUser BusinessRulesFieldsByUser = new BusinessRules.BusinessRules.FieldsByUser(adaptadorFieldsByUser.Object);
            var objReturn = BusinessRulesFieldsByUser.Count(null);

            Assert.IsTrue(objReturn == 0);
        }
Beispiel #4
0
        public void ToList()
        {
            BusinessRules.Interfaces.IFieldsByUser BusinessRulesFieldsByUser = new BusinessRules.BusinessRules.FieldsByUser(adaptadorFieldsByUser.Object);
            var lstReturn = BusinessRulesFieldsByUser.ToList();

            Assert.IsTrue(lstReturn != null && lstReturn.Count > 0);
        }
Beispiel #5
0
        public void Count()
        {
            BusinessRules.Interfaces.IFieldsByUser BusinessRulesFieldsByUser = new BusinessRules.BusinessRules.FieldsByUser(adaptadorFieldsByUser.Object);
            var objReturn = BusinessRulesFieldsByUser.Count(x => x.IdField == 1);

            Assert.IsTrue(objReturn > 0);
        }
Beispiel #6
0
        public void DeleteRangeNull()
        {
            adaptadorFieldsByUser.Setup(item => item.SaveChanges()).Returns(1);
            BusinessRules.Interfaces.IFieldsByUser BusinessRulesFieldsByUser = new BusinessRules.BusinessRules.FieldsByUser(adaptadorFieldsByUser.Object);
            var objReturn = BusinessRulesFieldsByUser.DeleteRange(null);

            Assert.IsTrue(objReturn == null);
        }
Beispiel #7
0
        public void DeleteRangeFalse()
        {
            adaptadorFieldsByUser.Setup(item => item.SaveChanges()).Returns(1);
            BusinessRules.Interfaces.IFieldsByUser BusinessRulesFieldsByUser = new BusinessRules.BusinessRules.FieldsByUser(adaptadorFieldsByUser.Object);
            var objReturn = BusinessRulesFieldsByUser.DeleteRange(x => x.IdField == 100);

            Assert.IsTrue(objReturn != null && !objReturn.Value);
        }
Beispiel #8
0
        public void EditNull()
        {
            Entities.FieldsByUser obj = null;
            adaptadorFieldsByUser.Setup(item => item.SaveChanges()).Returns(null);
            BusinessRules.Interfaces.IFieldsByUser BusinessRulesFieldsByUser = new BusinessRules.BusinessRules.FieldsByUser(adaptadorFieldsByUser.Object);
            var objReturn = BusinessRulesFieldsByUser.Edit(obj);

            Assert.IsTrue(objReturn == null);
        }
Beispiel #9
0
        public void CreateListNull()
        {
            List <Entities.FieldsByUser> lst = null;

            adaptadorFieldsByUser.Setup(item => item.SaveChanges()).Returns(null);
            BusinessRules.Interfaces.IFieldsByUser BusinessRulesFieldsByUser = new BusinessRules.BusinessRules.FieldsByUser(adaptadorFieldsByUser.Object);
            var objReturn = BusinessRulesFieldsByUser.Create(lst);

            Assert.IsTrue(objReturn == null);
        }
Beispiel #10
0
 public void DeleteExpressionNotFind()
 {
     try
     {
         BusinessRules.Interfaces.IFieldsByUser BusinessRulesFieldsByUser = new BusinessRules.BusinessRules.FieldsByUser(adaptadorFieldsByUser.Object);
         var objReturn = BusinessRulesFieldsByUser.Delete(x => x.IdField == 200);
     }
     catch (Exception ex)
     {
         Assert.IsTrue(ex.Message == "");
     }
 }
Beispiel #11
0
        public void Delete()
        {
            var obj = new Entities.FieldsByUser {
                IdField = 1, IdUser = 2
            };

            adaptadorFieldsByUser.Setup(item => item.SaveChanges()).Returns(1);
            BusinessRules.Interfaces.IFieldsByUser BusinessRulesFieldsByUser = new BusinessRules.BusinessRules.FieldsByUser(adaptadorFieldsByUser.Object);
            var objReturn = BusinessRulesFieldsByUser.Delete(obj);

            Assert.IsTrue(objReturn != null && objReturn.Value);
        }
Beispiel #12
0
        public void EditList()
        {
            var lst = new List <Entities.FieldsByUser>()
            {
                new Entities.FieldsByUser {
                    IdField = 3, IdUser = 3
                },
                new Entities.FieldsByUser {
                    IdField = 4, IdUser = 3
                }
            };

            adaptadorFieldsByUser.Setup(item => item.SaveChanges()).Returns(lst.Count);
            BusinessRules.Interfaces.IFieldsByUser BusinessRulesFieldsByUser = new BusinessRules.BusinessRules.FieldsByUser(adaptadorFieldsByUser.Object);
            var objReturn = BusinessRulesFieldsByUser.Edit(lst);

            Assert.IsTrue(objReturn != null && objReturn.Value);
        }
Beispiel #13
0
        public void CreateList()
        {
            var lst = new List <Entities.FieldsByUser>()
            {
                new Entities.FieldsByUser {
                    IdUser = 3, Value = "3"
                },
                new Entities.FieldsByUser {
                    IdUser = 4, Value = "3"
                }
            };

            adaptadorFieldsByUser.Setup(item => item.SaveChanges()).Returns(lst.Count);
            BusinessRules.Interfaces.IFieldsByUser BusinessRulesFieldsByUser = new BusinessRules.BusinessRules.FieldsByUser(adaptadorFieldsByUser.Object);
            var objReturn = BusinessRulesFieldsByUser.Create(lst);

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