public void Constructor_OptionsFileAvailable_UsingOptionsFileData() { const string logFileName = "hs071_opt.txt"; if (File.Exists(logFileName)) { File.Delete(logFileName); } const string optFileName = "ipopt.opt"; File.WriteAllLines(optFileName, new[] { String.Format("output_file {0}", logFileName) }); var instance = new HS071(); double obj; var x = new[] { 1.0, 5.0, 5.0, 1.0 }; instance.SolveProblem(x, out obj); instance.Dispose(); if (File.Exists(optFileName)) { File.Delete(optFileName); } const bool expected = true; var actual = File.Exists(logFileName); Assert.AreEqual(expected, actual); }
public void Teardown() { _instance.Dispose(); _instance = null; }