public void UpdateProductTest() { var result = UpdateProduct(_tf.Input("Pathway.wxs"), "1.13.4.4658", "BTE"); const bool overwrite = true; File.Copy(result, _tf.Output("Pathway.wxs"), overwrite); File.Delete(result); XmlAssert.AreEqual(_tf.Expected("Pathway.wxs"), _tf.Output("Pathway.wxs"), "Pathway Product File mismatch on insert"); }
[Category("SkipOnTeamCity")] // Failed to find expected file on Linux? public void CreateTest() { try { Pdf target = new Pdf(_tf.Copy("T1.xhtml"), _tf.Copy("T1.css")); string outName = _tf.Output("T1.pdf"); File.Delete(_tf.Output("T1.pdf")); target.Create(outName); bool fileOutputCreated = false; bool fileExpectedCreated = false; if (File.Exists(_tf.Output("T1.pdf"))) { fileOutputCreated = true; } if (File.Exists(_tf.Expected("T1.pdf"))) { fileExpectedCreated = true; } Assert.IsTrue(fileOutputCreated); Assert.IsTrue(fileExpectedCreated); } catch (Pdf.MISSINGPRINCE) // If Prince not installed, ignore test { } }
public void AddChaptersTest() { const string fileName = "DEU.SFM"; string inputFullName = _testFiles.Input(fileName); string outputFullName = _testFiles.SubOutput("SFM", fileName); File.Copy(inputFullName, outputFullName); PartialBooks.AddChapters(_testFiles.Output("SFM")); TextFileAssert.AreEqual(_testFiles.Expected(fileName), outputFullName); }
public void LaunchTest() { Common.Testing = true; PublicationInformation projInfo = new PublicationInformation(); projInfo.DefaultXhtmlFileWithPath = _testFiles.Copy("sena3-imba.xhtml"); projInfo.DefaultCssFileWithPath = _testFiles.Copy("sena3-imba.css"); projInfo.IsLexiconSectionExist = true; projInfo.ProjectInputType = "Dictionary"; Launch(projInfo); Assert.True(File.Exists(_testFiles.Output("DfM copyright notice.txt"))); TextFileAssert.AreEqual(_testFiles.Expected("main.txt"), _testFiles.Output("main.txt"), "main.txt"); }
public void ProcessTreeTest() { if (Common.IsUnixOS()) { return; } ResetIds(); var inputGuids = _tf.Input("FileLibrary.xml"); LoadGuids(inputGuids); ApplicationFileName = "Application.wxs"; DirectoryInfo directoryInfo = new DirectoryInfo(_tf.Input(@"output\Release")); foreach (DirectoryInfo directory in directoryInfo.GetDirectories()) { ResetFileComponents(); ProcessTree((XmlElement)XDoc.SelectSingleNode("//*[@Id='APPLICATIONFOLDER']"), directory.FullName); AddFeatures(); } // Check File & Features Match var actualPath = _tf.Output("Application.wxs"); var writer = XmlTextWriter.Create(actualPath, new XmlWriterSettings { Indent = true, Encoding = Encoding.UTF8 }); XDoc.WriteTo(writer); writer.Close(); XmlAssert.AreEqual(_tf.Expected("Application.wxs"), actualPath, "File Feature format changed"); // Check no Guids created var actualGuids = _tf.Output("FileLibrary.xml"); SaveGuids(actualGuids); XmlAssert.AreEqual(inputGuids, actualGuids, "Guids changed"); }