public void RunTests_should_generate_correct_test_results() { var handler = TestActionDispatcher.Create((TestExecutionContext c) => { }); var results = RunTests( TestData.Table( TestData.Create("a", "b"), TestData.Create("x", "y") ), handler.Invoke ); var baseName = GetType() + "." + nameof(RunTests_should_generate_correct_test_results); Assert.HasCount(2, results.Children); Assert.Equal(TestStatus.Passed, results.Children[0].Status); Assert.Equal(TestStatus.Passed, results.Children[1].Status); // Tests could have been shuffled, but ensure both are present string bothTests = string.Join( "\n", results.Children[0].DisplayName, results.Children[1].DisplayName ); Assert.Contains($"{baseName} dynamic A #0 (a,b)", bothTests); Assert.Contains($"{baseName} dynamic A #1 (x,y)", bothTests); }
public void RunTests_should_process_test_data() { var handler = TestActionDispatcher.Create((TestExecutionContext c) => {}); var results = RunTests( TestData.Table( TestData.Create("a", "b"), TestData.Create("x", "y") ), handler.Invoke ); Assert.Equal(2, handler.CallCount); // Tests could have been shuffled, but ensure both are present var allArgs = handler.Calls.Select(c => string.Join(" ", c.Args.TestData)).ToList(); Assert.Contains("a b", allArgs); Assert.Contains("x y", allArgs); }