public void EndsWithWorksInODataFilter()
 {
     var param = new InputParam2
     {
         Param = new InputParam1
         {
             Value = "foo"
         }
     };
     var result = FilterString.Generate<Param1>(p => p.Foo.EndsWith(param.Param.Value));
     Assert.Equal("endswith(foo, 'foo') eq true", result);
 }
 public void VerifyDeepPropertiesInODataFilter()
 {
     var param = new InputParam2
     {
         Param = new InputParam1
         {
             Value = "foo"
         }
     };
     var result = FilterString.Generate<Param1>(p => p.Foo == param.Param.Value);
     Assert.Equal("foo eq 'foo'", result);
 }
예제 #3
0
        public void StringContainsWorksInODataFilter()
        {
            var param = new InputParam2
            {
                Param = new InputParam1
                {
                    Value = "foo"
                }
            };
            var result = FilterString.Generate <Param1>(p => p.Foo.Contains(param.Param.Value));

            Assert.Equal("foo/any(c: c eq 'foo')", result);
        }
예제 #4
0
        public void EndsWithWorksInODataFilter()
        {
            var param = new InputParam2
            {
                Param = new InputParam1
                {
                    Value = "foo"
                }
            };
            var result = FilterString.Generate <Param1>(p => p.Foo.EndsWith(param.Param.Value));

            Assert.Equal("endswith(foo, 'foo') eq true", result);
        }
예제 #5
0
        public void VerifyDeepPropertiesInODataFilter()
        {
            var param = new InputParam2
            {
                Param = new InputParam1
                {
                    Value = "foo"
                }
            };
            var result = FilterString.Generate <Param1>(p => p.Foo == param.Param.Value);

            Assert.Equal("foo eq 'foo'", result);
        }
        public void UnsupportedMethodThrowsNotSupportedException()
        {
            var param = new InputParam2
            {
                Param = new InputParam1
                {
                    Value = "foo"
                }
            };

            Assert.Throws <NotSupportedException>(
                () => FilterString.Generate <Param1>(p => p.Foo.Replace(" ", "") == "abc"));
        }
 public void StringContainsWorksInODataFilter()
 {
     var param = new InputParam2
     {
         Param = new InputParam1
         {
             Value = "foo"
         }
     };
     var result = FilterString.Generate<Param1>(p => p.Foo.Contains(param.Param.Value));
     Assert.Equal("foo/any(c: c eq 'foo')", result);
 }
 public void UnsupportedMethodThrowsNotSupportedException()
 {
     var param = new InputParam2
     {
         Param = new InputParam1
         {
             Value = "foo"
         }
     };
     Assert.Throws<NotSupportedException>(
         () => FilterString.Generate<Param1>(p => p.Foo.Replace(" ", "") == "abc"));
 }