public void WhenSetMultiLineConditionThenResetSimpleCondition() { var hbmFilter = new HbmFilter(); var mapper = new FilterMapper("MyFilter", hbmFilter); mapper.Condition("aFiled = :aParameter"); mapper.Condition("aFiled = :aParameter" + Environment.NewLine + "AND anotherField = :anotherParam"); hbmFilter.condition.Should().Be.Null(); hbmFilter.Text.Should().Have.SameSequenceAs("aFiled = :aParameter", "AND anotherField = :anotherParam"); }
public void WhenSetEmptyConditionThenSetBothConditionToNull() { var hbmFilter = new HbmFilter(); var mapper = new FilterMapper("MyFilter", hbmFilter); mapper.Condition(string.Empty); hbmFilter.condition.Should().Be.Null(); hbmFilter.Text.Should().Be.Null(); mapper.Condition(" "); hbmFilter.condition.Should().Be.Null(); hbmFilter.Text.Should().Be.Null(); }
public void WhenSetNullConditionThenSetBothConditionToNull() { var hbmFilter = new HbmFilter(); var mapper = new FilterMapper("MyFilter", hbmFilter); mapper.Condition(null); hbmFilter.condition.Should().Be.Null(); hbmFilter.Text.Should().Be.Null(); }
public void WhenSetSingleLineConditionThenSetSimpleCondition() { var hbmFilter = new HbmFilter(); var mapper = new FilterMapper("MyFilter", hbmFilter); mapper.Condition("aFiled = :aParameter"); hbmFilter.condition.Should().Be("aFiled = :aParameter"); hbmFilter.Text.Should().Be.Null(); }
public void WhenSetSingleLineConditionThenResetTextCondition() { var hbmFilter = new HbmFilter(); var mapper = new FilterMapper("MyFilter", hbmFilter); mapper.Condition("aFiled = :aParameter" + Environment.NewLine + "AND anotherField = :anotherParam"); mapper.Condition("aFiled = :aParameter"); mapper.Condition("aFiled = :aParameter"); hbmFilter.Text.Should().Be.Null(); }