Esempio n. 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));
 }
Esempio n. 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));
 }
Esempio n. 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));
 }
 public void when_rawvalue_is_null_then_validation_passes()
 {
     var pa = new ProductAttributeBuilder().WithRawValue(null).Build();
     AssertIsValid(pa);
 }
 public void when_rawvalue_is_more_than_50_characters_then_validation_fails()
 {
     var pa = new ProductAttributeBuilder().WithRawValue(GetCharacters(51)).Build();
     AssertInvalidWithAtLeastOneErrorOnProperty(pa, "RawValue");
 }
 public void when_rawvalue_is_less_than_51_characters_then_validation_passes()
 {
     var pa = new ProductAttributeBuilder().WithRawValue(GetCharacters(50)).Build();
     AssertIsValid(pa);
 }