Ejemplo n.º 1
0
        public void CreateUniqueNameTest()
        {
            report = new Report();

            Base page = new ReportPage();

            page.Name = "Page1";
            report.AddChild(page);

            page = new ReportPage();
            page.CreateUniqueName();
            report.AddChild(page);

            Assert.NotEqual(report.Pages[0].Name, report.Pages[1].Name);
        }
Ejemplo n.º 2
0
        public void ClearTest()
        {
            report = new Report();

            Base page = new ReportPage();

            page.Name = "Page1";
            report.AddChild(page);

            page = new ReportPage();
            page.CreateUniqueName();
            report.AddChild(page);

            report.Clear();

            Base foundedPage = report.FindObject("Page1");

            Assert.True(foundedPage == null);
        }
Ejemplo n.º 3
0
        public void FindObjectTest()
        {
            report = new Report();

            Base page = new ReportPage();

            page.Name = "TestPage";
            report.AddChild(page);

            Base foundedPage = report.FindObject("TestPage");

            Assert.Equal(page, foundedPage);
        }
Ejemplo n.º 4
0
        public void AddPageFindObjectTest(string pageName)
        {
            report = new Report();
            ReportPage page = new ReportPage();

            page.Name = pageName;
            report.AddChild(page);

            Base foundedPage = report.FindObject(pageName);

            if (foundedPage != null)
            {
                Assert.Equal(page, foundedPage);
            }
        }
Ejemplo n.º 5
0
        public override void VisitEntityGroup(UTinyEntityGroup entityGroup)
        {
            var begin = Writer.Length;

            Writer.Line($"{UTinyHTML5Builder.KEntityGroupNamespace}.{Module.Namespace}.{entityGroup.Name}.name = {EscapeJsString(entityGroup.Name)};");
            Writer.WriteRaw($"{UTinyHTML5Builder.KEntityGroupNamespace}.{Module.Namespace}.{entityGroup.Name}.load = ");
            WriteEntityGroupSetupFunction(Writer, Project, entityGroup, WriteEntityGroupComponent, WriteEntityLayer);

            Report.AddChild(entityGroup.Name, System.Text.Encoding.ASCII.GetBytes(Writer.Substring(begin)));

#if UNITY_EDITOR_WIN
            Writer.Length -= 2;
#else
            Writer.Length -= 1;
#endif
        }