public void ExecutorInitializeWithValidTestCaseFilterShouldAddTestCaseFilterToCommandLineOptions() { var options = CommandLineOptions.Instance; TestCaseFilterArgumentExecutor executor = new TestCaseFilterArgumentExecutor(options); executor.Initialize("Debug"); Assert.AreEqual("Debug", options.TestCaseFilterValue); }
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."); } }
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); }