public void WrongFilePath() { // This will not inhibit the prepare files routine var program = new CustomizableMockedProgram(() => { }, null, new string[] { ParameterUtils.FileArgumentParameter, Path.Combine(PathUtils.CurrentDirectoryWildcard, TestObjects.NotExistingFile) }); program.Execute(); Assert.AreEqual(true, program.ErrorHandled, "Error should have been handled!"); Assert.IsNotNull(program.ThrownProgramException, "Program expected to emit exception!"); Assert.IsInstanceOfType(program.ThrownProgramException, typeof(FileNotFoundException)); }
public void RelativeFilePath() { // This will not inhibit the prepare files routine var program = new CustomizableMockedProgram(() => { }, null, new string[] { ParameterUtils.FileArgumentParameter, Path.Combine(PathUtils.CurrentDirectoryWildcard, TestObjects.EmptyFile) }); program.Execute(); Assert.AreEqual(false, program.ErrorHandled, "No error expected!"); Assert.AreEqual(Path.Combine(PathUtils.ApplicationExecutingPath, TestObjects.EmptyFile), program.FileConversionRunnerFilePath, "Wrong acquired file path!"); }
public void AbsoluteFilePath() { string absoluteFilePath = Path.Combine(PathUtils.ApplicationExecutingPath, TestObjects.EmptyFile); // This will not inhibit the prepare files routine var program = new CustomizableMockedProgram(() => { }, null, new string[] { ParameterUtils.FileArgumentParameter, absoluteFilePath }); program.Execute(); Assert.AreEqual(false, program.ErrorHandled, "No error expected!"); Assert.AreEqual(absoluteFilePath, program.FilePath, "Wrong acquired file path!"); }