public void DeleteExpression() { adaptadorTypeFields.Setup(item => item.SaveChanges()).Returns(1); BusinessRules.Interfaces.ITypeFields BusinessRulesTypeFields = new BusinessRules.BusinessRules.TypeFields(adaptadorTypeFields.Object); var objReturn = BusinessRulesTypeFields.Delete(x => x.Id == 1); Assert.IsTrue(objReturn != null && objReturn.Value); }
public void DeleteNull() { Entities.TypeFields obj = null; adaptadorTypeFields.Setup(item => item.SaveChanges()).Returns(null); BusinessRules.Interfaces.ITypeFields BusinessRulesTypeFields = new BusinessRules.BusinessRules.TypeFields(adaptadorTypeFields.Object); var objReturn = BusinessRulesTypeFields.Delete(obj); Assert.IsTrue(objReturn == null); }
public void DeleteExpressionNotFind() { try { BusinessRules.Interfaces.ITypeFields BusinessRulesTypeFields = new BusinessRules.BusinessRules.TypeFields(adaptadorTypeFields.Object); var objReturn = BusinessRulesTypeFields.Delete(x => x.Id == 200); } catch (Exception ex) { Assert.IsTrue(ex.Message == ""); } }
public void Delete() { var obj = new Entities.TypeFields { Id = 1 }; adaptadorTypeFields.Setup(item => item.SaveChanges()).Returns(1); BusinessRules.Interfaces.ITypeFields BusinessRulesTypeFields = new BusinessRules.BusinessRules.TypeFields(adaptadorTypeFields.Object); var objReturn = BusinessRulesTypeFields.Delete(obj); Assert.IsTrue(objReturn != null && objReturn.Value); }