Example #1
0
    public void Stringify_OnlyTArrayTest_float(Result result)
    {
        var json = JsonStringify.Stringify(StArr.To(1, 2, 3.14f));

        if (json != "[1,2,3.14]")
        {
            result.Invoke(Fail("Parsed to " + json));
        }
        result.Invoke(Pass());
    }
Example #2
0
    public void Stringify_OnlyTArrayTest_string(Result result)
    {
        var json = JsonStringify.Stringify(StArr.To(1, 2, "abs"));

        if (json != "[1,2,\"abs\"]")
        {
            result.Invoke(Fail("Parsed to " + json));
        }
        result.Invoke(Pass());
    }
Example #3
0
    public string ToArrayTest()
    {
        var arr = StArr.To("a", 1, 2, 3, "t");

        if (!arr.GetType().IsArray)
        {
            return("配列の生成に失敗しています");
        }
        return("");
    }
Example #4
0
    public void Stringify_OnlyTArrayTest_int_1(Result result)
    {
        var json = JsonStringify.Stringify(StArr.To(1));

        if (json != "[1]")
        {
            result.Invoke(Fail("Parsed to " + json));
        }
        result.Invoke(Pass());
    }
Example #5
0
    public string StringifyTest()
    {
        var arr = StArr.To("a", 1, "b");
        var str = arr.Stringify(",");

        if (str != "\"a\",1,\"b\"")
        {
            return(Fail("文字列化に失敗 " + str));
        }
        return(Pass());
    }
Example #6
0
    public string StringifyTestHST2()
    {
        var arr = StArr.To("a", 1);
        var str = arr.StringifyBasic(",");

        if (str != h + "\"a\",1" + t)
        {
            return(Fail("文字列化に失敗 " + str));
        }
        return(Pass());
    }
Example #7
0
    public void Stringify_ArrayIncludeObjectTest_1(Result result)
    {
        // {"a":[1,2,3]}
        var json = JsonStringify.Stringify(new ObjDict {
            { "a", StArr.To(1, 2, 3).ToObjArr() }
        });

        if (json != "{\"a\":[1,2,3]}")
        {
            result.Invoke(Fail("Parsed to " + json));
        }
        result.Invoke(Pass());
    }
Example #8
0
    public string ToObjArrTest()
    {
        var arr = StArr.To("a", 1, 2, 3, "t");
        // if (ar2 [0].GetType().Name != "object")
        //   { return "型変換に失敗しています" + ar2 [0].GetType().Name; }
        // インスタンスの実装を掘り返しちゃう
        var ar3 = arr as object [];

        if (ar3 == null)
        {
            return("型変換に失敗しています");
        }
        return("");
    }
Example #9
0
    public void Stringify_ArrayIncludeObjectTest_2(Result result)
    {
        // {"a":[1,2,3],"c":"d"}

        var json = JsonStringify.Stringify(new ObjDict {
            { "a", StArr.To(1, 2, 3) }, { "c", "d" }
        });

        if (json != "{\"a\":[1,2,3],\"c\":\"d\"}")
        {
            result.Invoke(Fail("Parsed to " + json));
        }

        result.Invoke(Pass());
    }