public void StreamingParameterShouldBeCaseInsensitive() { TestMediaTypeWithFormat.GetResponseTypeFromAccept("appLICatIOn/jSOn;OdAtA.sTrEaMinG=TrUe", ODataVersion.V4).Should().BeJsonLight().And.BeStreaming(); TestMediaTypeWithFormat.GetResponseTypeFromAccept("APpLiCAtIOn/jSoN;oDaTa.stReAMinG=fAlSe", ODataVersion.V4).Should().BeJsonLight().And.NotBeStreaming(); TestMediaTypeWithFormat.ParseContentType("appLICatIOn/jSOn;OdAtA.sTrEaMinG=TrUe", ODataVersion.V4).Should().BeJsonLight().And.BeStreaming(); TestMediaTypeWithFormat.ParseContentType("APpLiCAtIOn/jSoN;oDaTa.stReAMinG=fAlSe", ODataVersion.V4).Should().BeJsonLight().And.NotBeStreaming(); }
public void Ieee754CompatibleShouldBeCaseInsensitive() { TestMediaTypeWithFormat.GetResponseTypeFromAccept("appLICatIOn/jSOn;ieee754Compatible=TRUE", ODataVersion.V4).Should().BeJsonLight().And.BeIeee754Compatible(); TestMediaTypeWithFormat.GetResponseTypeFromAccept("appLICatIOn/jSOn;ieee754Compatible=False", ODataVersion.V4).Should().BeJsonLight().And.NotBeIeee754Compatible(); TestMediaTypeWithFormat.ParseContentType("appLICatIOn/jSOn;ieee754Compatible=TRUE", ODataVersion.V4).Should().BeJsonLight().And.BeIeee754Compatible(); TestMediaTypeWithFormat.ParseContentType("appLICatIOn/jSOn;ieee754Compatible=False", ODataVersion.V4).Should().BeJsonLight().And.NotBeIeee754Compatible(); }
public void ODataParameterShouldBeCaseInsensitive() { TestMediaTypeWithFormat.GetResponseTypeFromAccept("appLICatIOn/jSOn;oDaTa.MeTaDAtA=MinIMaL", ODataVersion.V4).Should().BeJsonLight().And.SpecifyDefaultMetadata(); TestMediaTypeWithFormat.GetResponseTypeFromAccept("appLICatIOn/jSOn;oDaTa.MeTaDAta=FuLl", ODataVersion.V4).Should().BeJsonLight().And.SpecifyAllMetadata(); TestMediaTypeWithFormat.GetResponseTypeFromAccept("appLICatIOn/jSOn;oDaTa.MetADAtA=nONe", ODataVersion.V4).Should().BeJsonLight().And.SpecifyNoMetadata(); TestMediaTypeWithFormat.ParseContentType("appLICatIOn/jSOn;oDaTa.MeTaDaTa=MinIMaL", ODataVersion.V4).Should().BeJsonLight().And.SpecifyDefaultMetadata(); TestMediaTypeWithFormat.ParseContentType("appLICatIOn/jSOn;ODATA.MeTaDaTa=FuLl", ODataVersion.V4).Should().BeJsonLight().And.SpecifyAllMetadata(); TestMediaTypeWithFormat.ParseContentType("appLICatIOn/jSOn;oDaTa.MeTaDaTa=nONe", ODataVersion.V4).Should().BeJsonLight().And.SpecifyNoMetadata(); }
public void MatchInfoCacheShouldWork() { var result1 = TestMediaTypeWithFormat.ParseContentType("application/json;odata.metadata=minimal", ODataVersion.V4); var result2 = TestMediaTypeWithFormat.ParseContentType("application/json;odata.metadata=minimal", ODataVersion.V4); var result3 = TestMediaTypeWithFormat.ParseContentType("application/json", ODataVersion.V4); var result4 = TestMediaTypeWithFormat.ParseContentType("application/json", ODataVersion.V4, ODataMediaTypeResolver.GetMediaTypeResolver(true)); var result5 = TestMediaTypeWithFormat.ParseContentType("application/json", ODataVersion.V4, ODataMediaTypeResolver.GetMediaTypeResolver(true)); result1.Should().BeJsonLight().And.SpecifyDefaultMetadata(); result2.Should().BeJsonLight().And.SpecifyDefaultMetadata(); result3.Should().BeUnspecifiedJson(); result4.Should().BeUnspecifiedJson(); result5.Should().BeUnspecifiedJson(); }
public void StreamingContentTypeShouldParseCorrectly() { TestMediaTypeWithFormat.ParseContentType("application/json;odata.metadata=minimal;odata.streaming=true", ODataVersion.V4).Should().BeJsonLight().And.BeStreaming(); }
public void UnqualifiedContentTypeInV3ShouldBeJsonLightButUnspecified() { TestMediaTypeWithFormat.ParseContentType("application/json", ODataVersion.V4).Should().BeUnspecifiedJson().And.HaveExactFormat(ODataFormat.Json); }
public void MetadataNoneContentTypeShouldSucceed() { TestMediaTypeWithFormat.ParseContentType("application/json;odata.metadata=none", ODataVersion.V4).Should().BeJsonLight().And.SpecifyNoMetadata(); }
public void DefaultMetadataContentTypeShouldSucceed() { TestMediaTypeWithFormat.ParseContentType("application/json;odata.metadata=minimal", ODataVersion.V4).Should().BeJsonLight().And.SpecifyDefaultMetadata(); }
public void UnspecifiedIeee754CompatibleInContentTypeShouldMeanNegative() { TestMediaTypeWithFormat.ParseContentType("application/json;odata.metadata=minimal", ODataVersion.V4).Should().BeJsonLight().And.NotBeIeee754Compatible(); }
public void UnrecognizedContentTypeIeee754CompatibleValueShouldMeanNegative() { TestMediaTypeWithFormat.ParseContentType("application/json;odata.metadata=minimal;IEEE754Compatible=none", ODataVersion.V4).Should().BeJsonLight().And.NotBeIeee754Compatible(); }
public void Ieee754CompatibleShouldParseCorrectly() { TestMediaTypeWithFormat.ParseContentType("application/json;odata.metadata=minimal;IEEE754Compatible=true", ODataVersion.V4).Should().BeJsonLight().And.BeIeee754Compatible(); }
public void UnrecognizedContentTypeParameterShouldMeanNoStreaming() { TestMediaTypeWithFormat.ParseContentType("application/json;odata.metadata=minimal;foo=bar", ODataVersion.V4).Should().BeJsonLight().And.NotBeStreaming(); }
public void UnspecifiedStreamingInContentTypeShouldMeanNoStreaming() { TestMediaTypeWithFormat.ParseContentType("application/json;odata.metadata=minimal;", ODataVersion.V4).Should().BeJsonLight().And.NotBeStreaming(); }