コード例 #1
0
        public void CreateJsonOptionsTest()
        {
            var options = JsonOptions.Create();

            options.PropertyNamingPolicy.Should().Be(JsonNamingPolicy.CamelCase);
            options.WriteIndented.Should().BeTrue();
            options.Converters.Should().ContainEquivalentOf(new JsonStringEnumConverter());
        }
コード例 #2
0
        private string GetResponseJson(string message, object errors = null)
        {
            var response = new ErrorResponse(message, errors);

            return(JsonConvert.SerializeObject(response, JsonOptions.Create()));
        }