Пример #1
0
        public void CanCountAtRoot()
        {
            var text = "[ {\"a\": 1}, {}, {}, \"dsd\", 1]";

            Assert.Equal(5, JsonCounter.Count(text, ""));
        }
Пример #2
0
        public void CountsCorrectlyDeep()
        {
            var text = File.ReadAllText("a.json");

            Assert.Equal(4, JsonCounter.Count(text, "siba/vala"));
        }
Пример #3
0
        public void ReturnsNullIfNotFound()
        {
            var text = File.ReadAllText("a.json");

            Assert.Equal(null, JsonCounter.Count(text, "recommendations/bibi"));
        }
Пример #4
0
        public void CountsCorrectlyShallow()
        {
            var text = File.ReadAllText("a.json");

            Assert.Equal(60, JsonCounter.Count(text, "recommendations"));
        }