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)); }
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)); }
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_raw_values_is_null_validation_fails() { var p = new PreferenceBuilder().WithRawValues(null).Build(); AssertInvalidWithAtLeastOneErrorOnProperty(p, "RawValues"); }
public void when_raw_values_is_more_than_500_characters_validation_passes() { var p = new PreferenceBuilder().WithRawValues(GetCharacters(501)).Build(); AssertInvalidWithAtLeastOneErrorOnProperty(p, "RawValues"); }
public void when_raw_values_is_less_than_501_characters_validation_passes() { var p = new PreferenceBuilder().WithRawValues(GetCharacters(500)).Build(); AssertIsValid(p); }