コード例 #1
0
        public void ShouldGenerateCommandLineParametersFromOptionsWithoutLogFormatWhenNotFound()
        {
            ITaskLogFactory myLogger = new Mock<ITaskLogFactory>().Object;

            var translator = new LogOptionCommandLineTranslator(LogFactoryRegistry);

            var bounce = new FakeBounce();

            bounce.LogFactory = myLogger;
            bounce.LogOptions.DescribeTasks = true;
            bounce.LogOptions.CommandOutput = false;
            bounce.LogOptions.LogLevel = LogLevel.Warning;

            var commandLine = translator.GenerateCommandLine(bounce);

            Assert.That(commandLine, ContainsArgument("/describe-tasks:true"));
            Assert.That(commandLine, ContainsArgument("/loglevel:warning"));
            Assert.That(commandLine, ContainsArgument("/command-output:false"));
            Assert.That(commandLine, Is.Not.StringMatching(@"(^|\s)/logformat:"));
        }
コード例 #2
0
        public void ShouldGenerateCommandLineParametersFromOptionsWithoutLogFormatWhenNotFound()
        {
            ITaskLogFactory myLogger = new Mock <ITaskLogFactory>().Object;

            var translator = new LogOptionCommandLineTranslator(LogFactoryRegistry);

            var bounce = new FakeBounce();

            bounce.LogFactory = myLogger;
            bounce.LogOptions.DescribeTasks = true;
            bounce.LogOptions.CommandOutput = false;
            bounce.LogOptions.LogLevel      = LogLevel.Warning;

            var commandLine = translator.GenerateCommandLine(bounce);

            Assert.That(commandLine, ContainsArgument("/describe-tasks:true"));
            Assert.That(commandLine, ContainsArgument("/loglevel:warning"));
            Assert.That(commandLine, ContainsArgument("/command-output:false"));
            Assert.That(commandLine, Is.Not.StringMatching(@"(^|\s)/logformat:"));
        }
コード例 #3
0
        public void ShouldGenerateCommandLineParametersFromOptions()
        {
            ITaskLogFactory myLogger = new Mock<ITaskLogFactory>().Object;
            LogFactoryRegistry.RegisterLogFactory("mylogger", myLogger);

            var translator = new LogOptionCommandLineTranslator(LogFactoryRegistry);

            var bounce = new FakeBounce();

            bounce.LogFactory = myLogger;
            bounce.LogOptions.DescribeTasks = true;
            bounce.LogOptions.CommandOutput = false;
            bounce.LogOptions.LogLevel = LogLevel.Warning;

            var commandLine = translator.GenerateCommandLine(bounce);

            Assert.That(commandLine, ContainsArgument("/describe-tasks:true"));
            Assert.That(commandLine, ContainsArgument("/loglevel:warning"));
            Assert.That(commandLine, ContainsArgument("/command-output:false"));
            Assert.That(commandLine, ContainsArgument("/logformat:mylogger"));
        }
コード例 #4
0
        public void ShouldGenerateCommandLineParametersFromOptions()
        {
            ITaskLogFactory myLogger = new Mock <ITaskLogFactory>().Object;

            LogFactoryRegistry.RegisterLogFactory("mylogger", myLogger);

            var translator = new LogOptionCommandLineTranslator(LogFactoryRegistry);

            var bounce = new FakeBounce();

            bounce.LogFactory = myLogger;
            bounce.LogOptions.DescribeTasks = true;
            bounce.LogOptions.CommandOutput = false;
            bounce.LogOptions.LogLevel      = LogLevel.Warning;

            var commandLine = translator.GenerateCommandLine(bounce);

            Assert.That(commandLine, ContainsArgument("/describe-tasks:true"));
            Assert.That(commandLine, ContainsArgument("/loglevel:warning"));
            Assert.That(commandLine, ContainsArgument("/command-output:false"));
            Assert.That(commandLine, ContainsArgument("/logformat:mylogger"));
        }