예제 #1
0
        //[Test]
        public void CanWorkWithNestedNamespaces()
        {
            Debug.Print(a2);
            var bSharpJsonParser = new BSharpJsonCompiler();

            bSharpJsonParser.LoadJsonContext(json: a2);
            bSharpJsonParser.CompileContext();
            var compiled = (BSharpContext)bSharpJsonParser.GetBSharpContext();

            Console.Write("0: " + compiled.Working[0].Compiled);
        }
예제 #2
0
        //[Test]
        public void CanWorkWithSimpleClasses()
        {
            Debug.Print(a1);
            var bSharpJsonParser = new BSharpJsonCompiler();

            bSharpJsonParser.LoadJsonContext(json: a1);
            bSharpJsonParser.CompileContext();
            var compiled = (BSharpContext)bSharpJsonParser.GetBSharpContext();

            Console.Write("0: " + compiled.Working[0].Compiled);
            Console.Write("1: " + compiled.Working[1].Compiled);

            Assert.AreEqual(2, compiled.Working.Count);
            Assert.AreEqual("f", compiled.Working[0].Compiled.Attribute("h").Value);
            Assert.AreEqual("tezt", compiled.Working[1].Compiled.Attribute("z").Value);
        }