Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
 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 == "");
     }
 }
Пример #4
0
        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);
        }