Esempio n. 1
0
        public void TildaSlideConstructorTest()
        {
            Slide      slide  = new TildaTests.Mocks.MockSlide();
            TildaSlide target = new TildaSlide(slide);

            Assert.AreEqual(slide, target.slide);
        }
Esempio n. 2
0
        public void backgroundImageExported()
        {
            if (Directory.Exists(Settings.outputPath))
            {
                Directory.Delete(Settings.outputPath, true);
            }
            Directory.CreateDirectory(Settings.outputPath);
            Directory.CreateDirectory(Settings.outputMediaFullPath);

            Slide      slide  = new TildaTests.Mocks.MockSlide();
            TildaSlide target = new TildaSlide(slide);
            String     actual = target.exportSlide();

            bool bgcreated = false;

            foreach (string file in Directory.GetFiles(Settings.outputMediaFullPath))
            {
                if (file.Contains("-bg.png"))
                {
                    bgcreated = true;
                }
            }

            Assert.AreEqual(true, bgcreated);
            Assert.AreEqual(true, actual.Contains("preso.shapes.push(preso.paper.image('assets/"));
            Assert.AreEqual(true, actual.Contains(",0,0,2160,3800));preso.shapes[(preso.shapes.length-1)].toBack();"));

            Directory.Delete(Settings.outputPath, true);
        }
Esempio n. 3
0
        public void slideJSExportCode()
        {
            if (Directory.Exists(Settings.outputPath))
            {
                Directory.Delete(Settings.outputPath, true);
            }
            Directory.CreateDirectory(Settings.outputPath);
            Directory.CreateDirectory(Settings.outputMediaFullPath);

            Slide      slide  = new TildaTests.Mocks.MockSlide();
            TildaSlide target = new TildaSlide(slide);
            String     actual = target.exportSlide();

            Assert.AreEqual(true, actual.Contains("function(){"));
            Assert.AreEqual(true, actual[actual.Length - 1] == '}');

            Directory.Delete(Settings.outputPath, true);
        }
Esempio n. 4
0
        public void backgroundImageExported()
        {
            if(Directory.Exists(Settings.outputPath))
                Directory.Delete(Settings.outputPath, true);
            Directory.CreateDirectory(Settings.outputPath);
            Directory.CreateDirectory(Settings.outputMediaFullPath);

            Slide slide = new TildaTests.Mocks.MockSlide();
            TildaSlide target = new TildaSlide(slide);
            String actual = target.exportSlide();

            bool bgcreated = false;
            foreach(string file in Directory.GetFiles(Settings.outputMediaFullPath)){
                if(file.Contains("-bg.png"))
                    bgcreated = true;
            }

            Assert.AreEqual(true, bgcreated);
            Assert.AreEqual(true, actual.Contains("preso.shapes.push(preso.paper.image('assets/"));
            Assert.AreEqual(true, actual.Contains(",0,0,2160,3800));preso.shapes[(preso.shapes.length-1)].toBack();"));

            Directory.Delete(Settings.outputPath, true);
        }
Esempio n. 5
0
        public void shapesAreOrderedBasedOnZOrderAndVisibilityIsNotConsidered()
        {
            if (Directory.Exists(Settings.outputPath))
            {
                Directory.Delete(Settings.outputPath, true);
            }
            Directory.CreateDirectory(Settings.outputPath);
            Directory.CreateDirectory(Settings.outputMediaFullPath);

            Slide      slide  = new TildaTests.Mocks.MockSlide();
            TildaSlide target = new TildaSlide(slide);
            Shape      tb     = slide.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationDownward, 0, 0, 100, 100);

            tb.TextFrame2.TextRange.Text = "Hello2";

            Shape tb2 = slide.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationDownward, 0, 0, 100, 100);

            tb2.TextFrame2.TextRange.Text = "Hello1";
            tb2.ZOrder(Office.MsoZOrderCmd.msoSendToBack);

            Shape tb3 = slide.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationDownward, 0, 0, 100, 100);

            tb3.TextFrame2.TextRange.Text = "Hello3";
            tb3.ZOrder(Office.MsoZOrderCmd.msoSendToBack);
            tb3.Visible = Office.MsoTriState.msoFalse;

            String actual = target.exportSlide();

            int first  = actual.IndexOf("Hello1");
            int second = actual.IndexOf("Hello2");
            int third  = actual.IndexOf("Hello3");

            Assert.AreEqual(true, first < second);
            Assert.AreEqual(true, third < second);

            Directory.Delete(Settings.outputPath, true);
        }
Esempio n. 6
0
        public void shapesAreOrderedBasedOnZOrderAndVisibilityIsNotConsidered()
        {
            if(Directory.Exists(Settings.outputPath))
                Directory.Delete(Settings.outputPath, true);
            Directory.CreateDirectory(Settings.outputPath);
            Directory.CreateDirectory(Settings.outputMediaFullPath);

            Slide slide = new TildaTests.Mocks.MockSlide();
            TildaSlide target = new TildaSlide(slide);
            Shape tb = slide.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationDownward, 0, 0, 100, 100);
            tb.TextFrame2.TextRange.Text = "Hello2";

            Shape tb2 = slide.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationDownward, 0, 0, 100, 100);
            tb2.TextFrame2.TextRange.Text = "Hello1";
            tb2.ZOrder(Office.MsoZOrderCmd.msoSendToBack);

            Shape tb3 = slide.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationDownward, 0, 0, 100, 100);
            tb3.TextFrame2.TextRange.Text = "Hello3";
            tb3.ZOrder(Office.MsoZOrderCmd.msoSendToBack);
            tb3.Visible = Office.MsoTriState.msoFalse;

            String actual = target.exportSlide();

            int first = actual.IndexOf("Hello1");
            int second = actual.IndexOf("Hello2");
            int third = actual.IndexOf("Hello3");

            Assert.AreEqual(true, first < second);
            Assert.AreEqual(true, third < second);

            Directory.Delete(Settings.outputPath, true);
        }
Esempio n. 7
0
 public void TildaSlideConstructorTest()
 {
     Slide slide = new TildaTests.Mocks.MockSlide();
     TildaSlide target = new TildaSlide(slide);
     Assert.AreEqual(slide, target.slide);
 }
Esempio n. 8
0
        public void slideJSExportCode()
        {
            if(Directory.Exists(Settings.outputPath))
                Directory.Delete(Settings.outputPath, true);
            Directory.CreateDirectory(Settings.outputPath);
            Directory.CreateDirectory(Settings.outputMediaFullPath);

            Slide slide = new TildaTests.Mocks.MockSlide();
            TildaSlide target = new TildaSlide(slide);
            String actual = target.exportSlide();

            Assert.AreEqual(true, actual.Contains("function(){"));
            Assert.AreEqual(true, actual[actual.Length-1]=='}');

            Directory.Delete(Settings.outputPath, true);
        }