Example #1
0
        public void GivenARequestWithPrettyIndentationUnset_WhenSerializingTheResponse_ThenPrettyIndentationIsNotApplied()
        {
            var context = new DefaultHttpContext();

            var isPretty = context.GetPrettyOrDefault();

            Assert.False(isPretty);
        }
Example #2
0
        public void GivenARequestWithPrettyIndentationSetToFalseInCaps_WhenSerializingTheResponse_ThenPrettyIndentationIsNotApplied()
        {
            var context = new DefaultHttpContext();

            context.Request.QueryString = QueryString.Create("_PRETTY", "False");

            var isPretty = context.GetPrettyOrDefault();

            Assert.False(isPretty);
        }
Example #3
0
        public void GivenARequestWithPrettyIndentationSetToUnrecognizableInput_WhenSerializingTheResponse_ThenPrettyIndentationIsNotApplied(string input)
        {
            var context = new DefaultHttpContext();

            context.Request.QueryString = QueryString.Create("_pretty", input);

            var isPretty = context.GetPrettyOrDefault();

            Assert.False(isPretty);
        }
Example #4
0
        public void GivenAnXmlRequestWithPrettyIndentationSetToTrue_WhenSerializingTheResponse_ThenPrettyIndentationIsApplied(string input)
        {
            var context = new DefaultHttpContext();

            context.Request.QueryString = QueryString.Create("_pretty", input);
            context.Request.QueryString.Add("_format", "xml");

            var isPretty = context.GetPrettyOrDefault();

            Assert.True(isPretty);
        }