Exemplo n.º 1
0
        public void SetV4ODataPrefixWritingTrue(ODataVersion?version)
        {
            var options = new ODataSimplifiedOptions(version);

            options.SetOmitODataPrefix(true, ODataVersion.V4);
            options.GetOmitODataPrefix().Should().Be(version != null && version != ODataVersion.V4);
            options.GetOmitODataPrefix(ODataVersion.V4).Should().BeTrue();
            options.GetOmitODataPrefix(ODataVersion.V401).Should().BeTrue();
            options.EnableWritingODataAnnotationWithoutPrefix.Should().Be(version != null && version != ODataVersion.V4);
        }
        public void SetV4ODataPrefixWritingTrue(ODataVersion?version)
        {
            var options = new ODataSimplifiedOptions(version);

            options.SetOmitODataPrefix(true, ODataVersion.V4);
            Assert.Equal(version != null && version != ODataVersion.V4, options.GetOmitODataPrefix());
            Assert.True(options.GetOmitODataPrefix(ODataVersion.V4));
            Assert.True(options.GetOmitODataPrefix(ODataVersion.V401));
            Assert.Equal(version != null && version != ODataVersion.V4, options.GetOmitODataPrefix());
        }
Exemplo n.º 3
0
        public void SetDefaultODataPrefixWritingFalse(ODataVersion?version)
        {
            var options = new ODataSimplifiedOptions(version);

            options.SetOmitODataPrefix(false);
            options.GetOmitODataPrefix().Should().BeFalse();
            options.GetOmitODataPrefix(ODataVersion.V4).Should().BeFalse();
            options.GetOmitODataPrefix(ODataVersion.V401).Should().BeFalse();
            options.EnableWritingODataAnnotationWithoutPrefix.Should().BeFalse();
        }
Exemplo n.º 4
0
        public void SetDefaultEnableWritingODataAnnotationWithoutPrefixTrue()
        {
            var options = new ODataSimplifiedOptions();

            options.EnableWritingODataAnnotationWithoutPrefix = true;
            options.GetOmitODataPrefix().Should().BeTrue();
            options.GetOmitODataPrefix(ODataVersion.V4).Should().BeTrue();
            options.GetOmitODataPrefix(ODataVersion.V401).Should().BeTrue();
            options.EnableWritingODataAnnotationWithoutPrefix.Should().BeTrue();
        }
        public void SetDefaultODataPrefixWritingFalse(ODataVersion?version)
        {
            var options = new ODataSimplifiedOptions(version);

            options.SetOmitODataPrefix(false);
            Assert.False(options.GetOmitODataPrefix());
            Assert.False(options.GetOmitODataPrefix(ODataVersion.V4));
            Assert.False(options.GetOmitODataPrefix(ODataVersion.V401));
            Assert.False(options.GetOmitODataPrefix());
        }
        public void SetDefaultEnableWritingODataAnnotationWithoutPrefixTrue()
        {
            var options = new ODataSimplifiedOptions();

            options.SetOmitODataPrefix(true);
            Assert.True(options.GetOmitODataPrefix());
            Assert.True(options.GetOmitODataPrefix(ODataVersion.V4));
            Assert.True(options.GetOmitODataPrefix(ODataVersion.V401));
            Assert.True(options.GetOmitODataPrefix());
        }
        public void SetEnableWritingODataAnnotationWithoutPrefixFalse(ODataVersion?version)
        {
            var options = new ODataSimplifiedOptions(version);

            options.SetOmitODataPrefix(false);
            Assert.False(options.GetOmitODataPrefix());
            Assert.False(options.GetOmitODataPrefix(ODataVersion.V4));
            Assert.False(options.GetOmitODataPrefix(ODataVersion.V401));
            Assert.False(options.GetOmitODataPrefix());
        }
        public void SetV401ODataPrefixWritingFalse(ODataVersion?version)
        {
            var options = new ODataSimplifiedOptions(version);

            options.SetOmitODataPrefix(false, ODataVersion.V401);
            Assert.Equal(version != null && version != ODataVersion.V4, options.GetOmitODataPrefix());
            Assert.False(options.GetOmitODataPrefix(ODataVersion.V4));
            Assert.False(options.GetOmitODataPrefix(ODataVersion.V401));
            Assert.Equal(version != null && version != ODataVersion.V4, options.EnableWritingODataAnnotationWithoutPrefix);
        }
Exemplo n.º 9
0
        public void Validate401Options()
        {
            var options = new ODataSimplifiedOptions(ODataVersion.V401);

            options.EnableWritingKeyAsSegment.Should().BeFalse();
            options.EnableReadingKeyAsSegment.Should().BeFalse();
            options.EnableParsingKeyAsSegmentUrl.Should().BeTrue();
            options.EnableReadingODataAnnotationWithoutPrefix.Should().BeTrue();
            options.EnableWritingODataAnnotationWithoutPrefix.Should().BeTrue();
            options.GetOmitODataPrefix().Should().BeTrue();
            options.GetOmitODataPrefix(ODataVersion.V4).Should().BeFalse();
            options.GetOmitODataPrefix(ODataVersion.V401).Should().BeTrue();
        }
        public void Validate401Options()
        {
            var options = new ODataSimplifiedOptions(ODataVersion.V401);

            Assert.False(options.EnableWritingKeyAsSegment);
            Assert.False(options.EnableReadingKeyAsSegment);
            Assert.True(options.EnableParsingKeyAsSegmentUrl);
            Assert.True(options.EnableReadingODataAnnotationWithoutPrefix);
            Assert.True(options.GetOmitODataPrefix());
            Assert.True(options.GetOmitODataPrefix());
            Assert.False(options.GetOmitODataPrefix(ODataVersion.V4));
            Assert.True(options.GetOmitODataPrefix(ODataVersion.V401));
        }