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 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 StartsWithWorksInODataFilter() { var param = new InputParam2 { Param = new InputParam1 { Value = "foo" } }; var result = FilterString.Generate<Param1>(p => p.Foo.StartsWith(param.Param.Value)); Assert.Equal("startswith(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); }
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")); }