Ejemplo n.º 1
0
        public void testEmitDefaultFalse()
        {
            EmitDefaultTest o = new EmitDefaultTest();

            o.zero     = null;
            o.one      = null;
            o.two      = 0;
            o.three    = 0;
            o.four     = 0.0;
            o.five     = 0.0;
            o.bSix     = false;
            o.bSeven   = false;
            o.nine     = 0;
            o.ten      = null;
            o.eleven   = null;
            o.twelve   = 0;
            o.thirteen = 0;
            o.forteen  = 0;

            JsonExpectationBlock jsonExpectationBlock = (theMock, json) =>
            {
                theMock.JsonStartObject(null, 0);
                theMock.JsonLeaf("one", null, false);
                theMock.JsonLeaf("three", "0", false);
                theMock.JsonLeaf("five", "0", false);
                theMock.JsonLeaf("bSeven", "false", false);
                theMock.JsonLeaf("nine", "0", false);
                theMock.JsonLeaf("eleven", null, false);
                theMock.JsonLeaf("twelve", "0", false);
                theMock.JsonLeaf("forteen", "0", false);
                theMock.JsonEndObject(json.Length - 1);
            };

            testInBuiltAndNativeJson(o, jsonExpectationBlock, "test EmitDefault s");
        }
        public void testEmitDefaultFalse()
        {
            EmitDefaultTest o = new EmitDefaultTest();
            o.zero = null;
            o.one = null;
            o.two = 0;
            o.three = 0;
            o.four = 0.0;
            o.five = 0.0;
            o.bSix = false;
            o.bSeven = false;
            o.nine = 0;
            o.ten = null;
            o.eleven = null;
            o.twelve = 0;
            o.thirteen = 0;
            o.forteen = 0;

            JsonExpectationBlock jsonExpectationBlock = (theMock, json) =>
            {
                theMock.JsonStartObject(null, 0);
                theMock.JsonLeaf("one", null, false);
                theMock.JsonLeaf("three", "0", false);
                theMock.JsonLeaf("five", "0", false);
                theMock.JsonLeaf("bSeven", "false", false);
                theMock.JsonLeaf("nine", "0", false);
                theMock.JsonLeaf("eleven", null, false);
                theMock.JsonLeaf("twelve", "0", false);
                theMock.JsonLeaf("forteen", "0", false);
                theMock.JsonEndObject(json.Length - 1);
            };

            testInBuiltAndNativeJson(o, jsonExpectationBlock, "test EmitDefault s");
        }