public void CanAccessCollectionProperty()
        {
            var relatives = GetPerson(1).Relatives;

            Assert.IsNotNull(relatives, "Failed to access collection");
            Assert.Greater(relatives.Count, 0, "no items in collection");
        }
Ejemplo n.º 2
0
        public void ShouldDisplayMaximized()
        {
            var win = driver.Window;

            win.SetSize(800, 600);

            win.Maximize();
            var size = win.Size();

            A.Greater(size.Width, 900);
            A.Greater(size.Height, 700);
        }
Ejemplo n.º 3
0
        public void ShouldCaptureToFile()
        {
            driver.Get("/elements.html");
            var imgname = string.Format("wd-capt-{0}-{1}.png"
                                        , Fixture.ToString().ToLower()
                                        , DateTime.Now.Ticks.ToString());

            driver.TakeScreenshot().SaveAs(@"%temp%\" + imgname);
            var file = new FileInfo(Environment.ExpandEnvironmentVariables(@"%temp%\" + imgname));

            A.Greater(file.Length, 10000);
            file.Delete();
        }
Ejemplo n.º 4
0
        public void SequenceStamp()
        {
            var le     = CreateLoggingEvent();
            var stamp  = new log4net.Util.Stamps.SequenceStamp();
            var stamp2 = new log4net.Util.Stamps.SequenceStamp()
            {
                Name = "stamp2"
            };

            stamp.StampEvent(le);
            stamp2.StampEvent(le);

            Assert.That(le.Properties["stamp"], Is.Not.Null, @"Properties[""stamp""]");
            Assert.That(le.Properties["stamp2"], Is.Not.Null, @"Properties[""stamp2""]");
            Assert.Greater((long)le.Properties["stamp2"], (long)le.Properties["stamp"], @"stamp2 > stamp");
        }
Ejemplo n.º 5
0
        public void ShouldCreatePDF()
        {
            string tempPath = System.IO.Path.GetTempPath() + @"\my-capture.pdf";

            if (System.IO.File.Exists(tempPath))
            {
                System.IO.File.Delete(tempPath);
            }

            var pdf = new PdfFile();

            //Define the PDF page size and margins

            pdf.SetPageSize(210, 297, "mm");
            pdf.SetMargins(10, 10, 10, 15, "mm");

            //Add a title and informations to the PDF
            pdf.AddTextCenter(text: "Selenium search result", size: 20, bold: true);
            pdf.AddTitle("Title A");
            pdf.AddText(text: "Description = Search for Eiffel tower", size: 9, color: "DarkBlue");
            pdf.AddLink("http://www.test.com", "Test link");

            //Add a text paragraph to the PDF file
            string text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam sit amet libero arcu, et molestie purus. Ut in sem lacus, sit amet rhoncus erat. In aliquet arcu at nunc porta sollicitudin. Cras ante nisl, hendrerit quis bibendum quis, egestas vitae mi. Donec ac felis at eros placerat iaculis. Nam quam sapien, scelerisque vel bibendum et, mollis sit amet augue. Nullam egestas, lectus ut laoreet vulputate, neque quam vestibulum sapien, ut vehicula nunc metus et nulla. Curabitur ac lorem augue. Nullam quis justo eu arcu volutpat ultrices ac at orci.";

            pdf.AddText(text: text, size: 10);

            pdf.AddPage();

            //Take a screenschot and add it to the PDF file
            using (var img = new Utils().TakeScreenShot()) {
                pdf.AddBookmark("Bookmark");
                pdf.AddTitle("Capture A");
                pdf.AddImage(img, false);
            }

            pdf.SaveAs(tempPath);

            A.True(System.IO.File.Exists(tempPath));
            A.Greater(new System.IO.FileInfo(tempPath).Length, 25000);
        }
Ejemplo n.º 6
0
        public void Test_that_it_works()
        {
            using (var tmpDir = new TemporaryDirectory())
            {
                var jsonOptionsPath = Path.Combine(tmpDir.Path, "options-test.json");

                var exePath = Common.AasxPackageExplorerExe();

                var pluginPath = Path.Combine(
                    TestContext.CurrentContext.TestDirectory,
                    "TestResources\\AasxPackageExplorer.Tests\\AasxPluginGenericForms.dll");

                Assert.IsTrue(File.Exists(pluginPath), pluginPath);

                var text =
                    $@"{{ ""PluginDll"": [ {{ ""Path"": {JsonConvert.ToString(pluginPath)}, ""Args"": [] }} ] }}";

                File.WriteAllText(jsonOptionsPath, text);

                var optionsInformation = App.InferOptions(
                    exePath, new[] { "-read-json", jsonOptionsPath });

                Assert.AreEqual(1, optionsInformation.PluginDll.Count);
                Assert.IsEmpty(optionsInformation.PluginDll[0].Args);
                Assert.AreEqual(null, optionsInformation.PluginDll[0].Options);
                Assert.AreEqual(null, optionsInformation.PluginDll[0].DefaultOptions);
                Assert.AreEqual(pluginPath, optionsInformation.PluginDll[0].Path);

                var loadedPlugins = App.LoadAndActivatePlugins(optionsInformation.PluginDll);

                Assert.AreEqual(new[] { "AasxPluginGenericForms" }, loadedPlugins.Keys.ToList());
                Assert.IsNotNull(loadedPlugins["AasxPluginGenericForms"]);

                // This is not a comprehensive test, but it would fail if the plugin DLL has not been properly loaded.
                Assert.Greater(loadedPlugins["AasxPluginGenericForms"].ListActions().Length, 0);
            }
        }