public void pmzImport() { // for now the path is hard coded, in the future it will be temporary dirs and // taken from the model string dbFileName = System.IO.Path.GetTempFileName(); string mapFileName = System.IO.Path.GetTempFileName(); m_rt.AddVariable("SFMImportFileName", MakeValidVarPath(dbFileName)); // import file m_rt.AddVariable("SFMMapFileName", MakeValidVarPath(mapFileName)); // map file StreamWriter writer = new StreamWriter(dbFileName); writer.WriteLine(@"\lx men"); writer.WriteLine(@"\mn man ï from moon"); writer.WriteLine(@"This is a test."); writer.WriteLine(@"Of a lónger field"); writer.WriteLine(@"\mn this is a good line."); writer.WriteLine(@"\mn2 hiâ there"); writer.WriteLine(@"\mn2 this is a good line."); writer.WriteLine(@"\notUsedMarker"); writer.Close(); try { // this script will use the SFMImportFileName for the import file m_rt.fromFile("pmzImport"); // Now check the output files against the key_output files // string keyP1 = "FLEX_A_Phase1Output.xml"; // phase 1 key output file // string keyP2 = "FLEX_A_Phase2Output.xml"; // phase 2 key output file // string keyP3 = "FLEX_A_Phase3Output.xml"; // phase 3 key output file // string keyP4 = "FLEX_A_Phase4Output.xml"; // phase 4 key output file // string keyPath = ""; // string tempPath = System.IO.Path.GetTempPath(); // if (tempPath.EndsWith(@"\") == false) // tempPath += @"\"; // tempPath += "LexText\\"; // The best way would be using the XmlDiffPatch by MS, but not installed on client machines yet // Microsoft.XmlDiffPatch.XmlDiff diff = new Microsoft.XmlDiffPatch.XmlDiff( // Microsoft.XmlDiffPatch.XmlDiffOptions.IgnoreChildOrder | // Microsoft.XmlDiffPatch.XmlDiffOptions.IgnoreComments | // Microsoft.XmlDiffPatch.XmlDiffOptions.IgnoreWhitespace ); // bool same = diff.Compare(tempPath+"Phase1Output.xml", "FLEX_A_Phase1Output.xml", false); // if (!same) // System.Diagnostics.Debug.WriteLine("Files weren't the same."); } finally { File.Delete(dbFileName); // be sure to remove the temp file after this test File.Delete(mapFileName); // be sure to remove the temp file after this test } }
public void Init() { m_rt = new RunTest("TE"); m_rt.AddVariable("TestBranchDir", m_testBranchDir); m_rt.AddVariable("TestCase", m_testCaseNumber.ToString()); #region // Save MachineName //if (Running_On_GX270()) // m_rt.AddVariable("Running_On_GX270", "TRUE"); //else // m_rt.AddVariable("Running_On_GX270", "FALSE"); #endregion }
public void Init() { m_rt = new RunTest("TE"); m_rt.AddVariable("TestBranchDir", testBranchDir); }