예제 #1
0
 public void when_preference_is_within_set_productattribute_then_match()
 {
     MetaAttribute houseSuburb = new MetaAttributeBuilder().HouseSuburb();
     Preference houseSuburbPreference = new PreferenceBuilder().WithMetaAttribute(houseSuburb).WithRawValues("Milton,Cleveland,Broken Hill").Build();
     ProductAttribute houseSuburbProductAttribute = new ProductAttributeBuilder().WithMetaAttribute(houseSuburb).WithRawValue("Cleveland").Build();
     Assert.IsTrue(houseSuburbPreference.IsMatchOn(houseSuburbProductAttribute));
 }
예제 #2
0
 public void when_preference_is_within_range_productattribute_then_match()
 {
     MetaAttribute housePrice = new MetaAttributeBuilder().HousePrice();
     Preference housePricePreference = new PreferenceBuilder().WithMetaAttribute(housePrice).WithRawValues("30000000-45000000").Build();
     ProductAttribute housePriceProductAttribute = new ProductAttributeBuilder().WithMetaAttribute(housePrice).WithRawValue("44000000").Build();
     Assert.IsTrue(housePricePreference.IsMatchOn(housePriceProductAttribute));
 }
예제 #3
0
 public void when_preference_and_productattribute_have_different_metaattribute_then_match()
 {
     MetaAttribute housePrice = new MetaAttributeBuilder().HousePrice();
     MetaAttribute houseSuburb = new MetaAttributeBuilder().HouseSuburb();
     Preference housePricePreference = new PreferenceBuilder().WithMetaAttribute(housePrice).WithRawValues("30000000-45000000").Build();
     ProductAttribute houseSuburbProductAttribute = new ProductAttributeBuilder().WithMetaAttribute(houseSuburb).WithRawValue("Cleveland").Build();
     Assert.IsTrue(housePricePreference.IsMatchOn(houseSuburbProductAttribute));
 }
예제 #4
0
 public void when_rawvalue_is_null_then_validation_passes()
 {
     var pa = new ProductAttributeBuilder().WithRawValue(null).Build();
     AssertIsValid(pa);
 }
예제 #5
0
 public void when_rawvalue_is_more_than_50_characters_then_validation_fails()
 {
     var pa = new ProductAttributeBuilder().WithRawValue(GetCharacters(51)).Build();
     AssertInvalidWithAtLeastOneErrorOnProperty(pa, "RawValue");
 }
예제 #6
0
 public void when_rawvalue_is_less_than_51_characters_then_validation_passes()
 {
     var pa = new ProductAttributeBuilder().WithRawValue(GetCharacters(50)).Build();
     AssertIsValid(pa);
 }