示例#1
0
        public void Factuare_To_Pdf()
        {
            var fe32 = Factuare_Create_Simple_Invoice_And_validate();

            var logoPath = "https://a248.e.akamai.net/assets.github.com/images/modules/header/logov6-hover.png";

            var unedoc = fe32.ToPdf(logoPath);

            Assert.IsNotNull(unedoc);

            var attachmentData = new BinaryAttachment("invoice.pdf", "application/pdf", unedoc.ToArray());

            TestLog.Attach(attachmentData);
        }
示例#2
0
 //commented out Proxy stuff because browserMobProxy is not implimented
 private void GetHarFile()
 {
     try
     {
         if (Config.Settings.httpProxy.startProxy)
         {
             var name = Common.GetShortTestName(80);
             proxy.SaveHarToFile();
             TestLog.Attach(new BinaryAttachment("HTTP_Traffic_" + name + ".har",
                                                 "application/json", File.ReadAllBytes(proxy.GetHarFilePath())));
             proxy.CreateHar();
         }
     }
     catch (Exception e)
     {
         throw new Exception("Error caught getting BMP Har File : " + e.Message);
     }
 }
        public void AttachedResources()
        {
            TestLog.WriteLine("Attached image.");
            TestLog.AttachImage("Image", Resources.MbUnitLogo);

            TestLog.WriteLine("Attached plain text.");
            TestLog.AttachPlainText("Plain Text", "This is some plain text.\nLalalala...");

            TestLog.WriteLine("Attached XML.");
            TestLog.AttachXml("XML", "<life><universe><everything>42</everything></universe></life>");

            TestLog.WriteLine("Attached XHTML.");
            TestLog.AttachXHtml("XHtml", "<p>Some <b>XHTML</b> markup.<br/>With a line break.</p>");

            TestLog.WriteLine("Attached HTML.");
            TestLog.AttachHtml("Html", "<p>Some <b>HTML</b> markup.<br>With a line break.</p>");

            TestLog.WriteLine("Attached binary data.");
            TestLog.Attach(new BinaryAttachment("Binary", "application/octet-stream", new byte[] { 67, 65, 66, 66, 65, 71, 69 }));

            TestLog.Write("Attached video.");
            TestLog.AttachVideo("Video", video);
        }
示例#4
0
 /// <summary>
 ///     Get the test result files and embed them into the report
 /// </summary>
 private void AttachTestFiles()
 {
     TestLog.Attach(new TextAttachment("LogFile.txt", "locator", GetLogFile()));
     TestLog.Attach(new TextAttachment("LogFile.xml", "locator", GetLogXmlFile()));
 }