public void SearchNull() { BusinessRules.Interfaces.IFieldsByUser BusinessRulesFieldsByUser = new BusinessRules.BusinessRules.FieldsByUser(adaptadorFieldsByUser.Object); var objReturn = BusinessRulesFieldsByUser.Search(null); Assert.IsTrue(objReturn == null); }
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); }
public void CountDefault() { BusinessRules.Interfaces.IFieldsByUser BusinessRulesFieldsByUser = new BusinessRules.BusinessRules.FieldsByUser(adaptadorFieldsByUser.Object); var objReturn = BusinessRulesFieldsByUser.Count(null); Assert.IsTrue(objReturn == 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); }
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); }
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); }
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); }
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); }
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); }
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 == ""); } }
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); }
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); }
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); }