public void ExecutorInitializeWithValidTestCaseFilterShouldAddTestCaseFilterToCommandLineOptions()
        {
            var options = CommandLineOptions.Instance;
            TestCaseFilterArgumentExecutor executor = new TestCaseFilterArgumentExecutor(options);

            executor.Initialize("Debug");
            Assert.AreEqual("Debug", options.TestCaseFilterValue);
        }
Exemple #2
0
        public void ExecutorInitializeWithNullOrEmptyTestCaseFilterShouldNotThrowWhenTestFilterWasSpecifiedByPreviousStep()
        {
            var options = CommandLineOptions.Instance;

            options.TestCaseFilterValue = "Test=FilterFromPreviousStep";
            TestCaseFilterArgumentExecutor executor = new TestCaseFilterArgumentExecutor(options);

            executor.Initialize(null);
        }
        public void ExecutorInitializeWithNullOrEmptyTestCaseFilterShouldThrowCommandLineException()
        {
            var options = CommandLineOptions.Instance;
            TestCaseFilterArgumentExecutor executor = new TestCaseFilterArgumentExecutor(options);

            try
            {
                executor.Initialize(null);
            }
            catch (Exception ex)
            {
                Assert.IsTrue(ex is CommandLineException);
                StringAssert.Contains(ex.Message, @"The /TestCaseFilter argument requires the filter value.");
            }
        }
Exemple #4
0
        public void ExecutorInitializeWithTestCaseFilterShouldMergeWithTheValueProvidedByPreviousStep()
        {
            var options      = CommandLineOptions.Instance;
            var defaultValue = "Test=FilterFromPreviousStep";

            options.TestCaseFilterValue = defaultValue;
            Assert.AreEqual(defaultValue, options.TestCaseFilterValue);
            TestCaseFilterArgumentExecutor executor = new TestCaseFilterArgumentExecutor(options);

            var value = "Test=NewFilter";

            executor.Initialize(value);

            var expectedValue = $"({defaultValue})&({value})";

            Assert.AreEqual(expectedValue, options.TestCaseFilterValue);
        }