public void Required_SetsPropertyValidatorRequiredToTrue_ReturnsRuleBuilder() { // Create Dependancies PropertyValidator <Customer, string> validator = PropertyValidatorFactory.DefaultCustomerNameValidator(); // Test var actionOptionBuilder = new ActionOptionBuilder <Customer, string>(validator); RuleBuilder <Customer, string> requiredResult = actionOptionBuilder.Required(); // Assert Assert.That(requiredResult, Is.InstanceOf <RuleBuilder <Customer, string> >()); }
If_NameLengtGreaterThan10_SetsPropertyValidatorCondition_ReturnsActionOptionBuilder() { // Create Dependancies PropertyValidator <Customer, string> validator = PropertyValidatorFactory.DefaultCustomerNameValidator(); // Test var actionOptionConditionBuilder = new ActionOptionConditionBuilder <Customer, string>(validator); ActionOptionBuilder <Customer, string> ifResult = actionOptionConditionBuilder.If(c => c.Name.Length > 10); // Assert Assert.That(validator.Condition, Is.Not.Null); }