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);
 }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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"));
 }