public void EditNull() { Entities.TypeFields obj = null; adaptadorTypeFields.Setup(item => item.SaveChanges()).Returns(null); BusinessRules.Interfaces.ITypeFields BusinessRulesTypeFields = new BusinessRules.BusinessRules.TypeFields(adaptadorTypeFields.Object); var objReturn = BusinessRulesTypeFields.Edit(obj); Assert.IsTrue(objReturn == null); }
public void Edit() { var obj = new Entities.TypeFields { Id = 1, Name = "Object" }; adaptadorTypeFields.Setup(item => item.SaveChanges()).Returns(1); BusinessRules.Interfaces.ITypeFields BusinessRulesTypeFields = new BusinessRules.BusinessRules.TypeFields(adaptadorTypeFields.Object); var objReturn = BusinessRulesTypeFields.Edit(obj); Assert.IsTrue(objReturn != null && objReturn.Value); }
public void EditList() { 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.Edit(lst); Assert.IsTrue(objReturn != null && objReturn.Value); }