コード例 #1
0
 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");
 }
コード例 #2
0
        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();
        }
コード例 #3
0
 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();
 }
コード例 #4
0
 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();
 }
コード例 #5
0
 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();
 }