Example #1
0
 public void ItShouldRunSuccessFulAppOnceAndLogOutputToNotifiers()
 {
     var process = new ExternalProcess();
     process.Run(".\\Tugboat\\Tugboat.exe", "\".\\Tugboat\\ConsoleAppTest.exe\"");
     var expectedLogFile = Minify(File.ReadAllText(LogFile));
     var actualLogFile = Minify(Resources.Success);
     Assert.That(expectedLogFile, Is.EqualTo(actualLogFile));
 }
Example #2
0
 public void ItShouldRunFailingApp2TimesAndLogOutputToNotifiers()
 {
     var process = new ExternalProcess();
     process.Run(".\\Tugboat\\Tugboat.exe", "\".\\Tugboat\\ConsoleAppTest.exe\" \"failexception\" \"2\"");
     var actualLog = Minify(File.ReadAllText(LogFile));
     var expectedLog = Minify(Resources.Failed2TimesWithException);
     Assert.That(actualLog, Contains.Substring(expectedLog));
 }
Example #3
0
 public void ItShouldRunFailingApp5TimesAndLogOutputToNotifiers()
 {
     var process = new ExternalProcess();
     process.Run(".\\Tugboat\\Tugboat.exe", "\".\\Tugboat\\ConsoleAppTest.exe\" \"failexitcode\" \"5\"");
     var actualLog = Minify(File.ReadAllText(LogFile));
     var expectedLog = Minify(Resources.Failed5TimesExitCode);
     Assert.That(actualLog, Is.EqualTo(expectedLog));
 }
Example #4
0
        public static void Main(string[] args)
        {
            var settings = new Settings();
            var spec = new ProcessStartSpecification(args, settings);
            var notifiers = new List<INotifier> {new ConsoleNotifier(), new EmailNotifier(settings), new FileNotifier()};
            var storage = new HdStorage();
            var runner = new ConsoleProcessRunner(spec, storage, notifiers);

            var process = new ExternalProcess();
            runner.Start(process);
        }