Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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!");
        }
Exemplo n.º 3
0
        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!");
        }
Exemplo n.º 4
0
        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!");
        }
Exemplo n.º 5
0
        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));
        }
Exemplo n.º 6
0
        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!");
        }