Ejemplo n.º 1
0
        public void writeGeneric()
        {
            string    path = tmpFile("write.generic");
            SkillFile sf   = SkillFile.open(path);

            reflectiveInit(sf);
            sf.close();
            File.Delete(path);
        }
Ejemplo n.º 2
0
        public void APITest_core_map3_acc_simple()
        {
            string    path = tmpFile("simple");
            SkillFile sf   = SkillFile.open(path, Mode.Create, Mode.Write);

            // create objects
            map3.T T = (map3.T)sf.Ts().make();
            // set fields
            T.Zref = (System.Collections.Generic.Dictionary <System.String, System.Collections.Generic.Dictionary <L, System.String> >)put(map <string, Dictionary <L, string> >(), "hallo", put(map <L, string>(), (L)null, "welt"));
            sf.close();

            { // read back and assert correctness
                SkillFile sf2 = SkillFile.open(sf.currentPath(), Mode.Read, Mode.ReadOnly);
                // check count per Type
                Assert.AreEqual(1, sf.Ts().staticSize());
                // create objects from file
                map3.T T_2 = (map3.T)sf2.Ts().getByID(T.SkillID);
                // assert fields
                Assert.IsTrue(T_2.Zref != null && Enumerable.SequenceEqual(T_2.Zref, put(map <string, Dictionary <L, string> >(), "hallo", put(map <L, string>(), (L)null, "welt"))));
            }
            File.Delete(path);
        }