Esempio n. 1
0
        public void APITest_restrictions_restrictionsCore_fail_restrictionsCore__fail__2()
        {
            string path = tmpFile("restrictionsCore_fail_2");

            try
            {
                SkillFile sf = SkillFile.open(path, Mode.Create, Mode.Write);

                // create objects
                restrictionsCore.ZSystem sys = (restrictionsCore.ZSystem)sf.ZSystems().make();
                // set fields
                sys.name    = (string)"null";
                sys.version = (float)(float)1.1;
                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.ZSystems().staticSize());
                    // create objects from file
                    restrictionsCore.ZSystem sys_2 = (restrictionsCore.ZSystem)sf2.ZSystems().getByID(sys.SkillID);
                    // assert fields
                    Assert.IsTrue(sys_2.name != null && sys_2.name.Equals("null"));
                    Assert.IsTrue(sys_2.version == (float)1.1);
                }
            }
            catch (SkillException)
            {
                return;
            }
            File.Delete(path);
        }