public void CSharpRulesIsPersistable( ) { IRulesFactory<BusinessEntity> factory = new CSharpRulesFactory<BusinessEntity>( ); factory.AddRule( RuleType.Persistence, "e.Value > 5", "Value must be greater than 5.", "Value" ); var businessEntity = new BusinessEntity( ); businessEntity.PersistenceRules.Add( factory.FindRules( RuleType.Persistence ) ); businessEntity.Value = 1; businessEntity.Value2 = 1; Assert.IsFalse( businessEntity.IsPersistable( ) ); Assert.IsFalse( businessEntity.IsValid( ) ); }
public void CSharpRulesIsPersistable( ) { IRulesFactory <BusinessEntity> factory = new CSharpRulesFactory <BusinessEntity>( ); factory.AddRule(RuleType.Persistence, "e.Value > 5", "Value must be greater than 5.", "Value"); var businessEntity = new BusinessEntity( ); businessEntity.PersistenceRules.Add(factory.FindRules(RuleType.Persistence)); businessEntity.Value = 1; businessEntity.Value2 = 1; Assert.IsFalse(businessEntity.IsPersistable( )); Assert.IsFalse(businessEntity.IsValid( )); }