Exemplo n.º 1
0
        public void ScriptShouldFailIfExecutableDoesNotExist()
        {
            const string executable = "TestingCalamariThisExecutableShouldNeverExist";
            var          subject    = new TestCommandLineRunner(new InMemoryLog(), new CalamariVariables());
            var          result     = subject.Execute(new CommandLineInvocation(executable, "--version"));

            result.HasErrors.Should().BeTrue();
            subject.Output.Errors.Should().Contain(CommandLineRunner.ConstructWin32ExceptionMessage(executable));
        }
        public void ScriptShouldFailIfExecutableDoesNotExist()
        {
            const string executable = "TestingCalamariThisExecutableShouldNeverExist";
            var          output     = new CaptureCommandOutput();
            var          subject    = new CommandLineRunner(output);
            var          result     = subject.Execute(new CommandLineInvocation(executable: executable, arguments: "--version"));

            result.HasErrors.Should().BeTrue();
            output.Errors.Should().Contain(CommandLineRunner.ConstructWin32ExceptionMessage(executable));
        }