コード例 #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));
        }
コード例 #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!");
        }
コード例 #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!");
        }
コード例 #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!");
        }
コード例 #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));
        }
コード例 #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!");
        }