コード例 #1
0
 public void minifying_JSON()
 {
     using (Stream fileStream = new FileStream(Path.Combine(TestHelper.DataFolder, "minifying.json"), FileMode.Open, FileAccess.Read))
     {
         string mini = JSONMinifier.Minify(new VirtualStringMatcher(new VirtualString(fileStream)));
         mini.Should().Be(@"{""v"":9.87e2,""a"":[8.65,true,{},{""x"":null,""y"":0.0},874]}");
     }
 }
コード例 #2
0
        public void minifying_JSON()
        {
            string data = @"
{
    ""v"": 9.87e2, 
    ""a"" : 
        [ 8.65, 
            true, 
            { } 
            , { ""x"" : null,           ""y"": 0.0      }
        , 874 
]
}";
            string mini = JSONMinifier.Minify(new VirtualStringMatcher(new FakeVirtualString(data)));

            mini.Should().Be(@"{""v"":9.87e2,""a"":[8.65,true,{},{""x"":null,""y"":0.0},874]}");
        }