in BoostTestAdapterNunit/BoostTestExecutorTest.cs [1055:1102]
public void TestDisabledTestsRunAllSettings()
{
this.RunContext.RegisterSettingProvider(BoostTestAdapterSettings.XmlRootName, new BoostTestAdapterSettingsProvider());
this.RunContext.LoadSettings("<RunSettings><BoostTest><RunDisabledTests>true</RunDisabledTests></BoostTest></RunSettings>");
string MySource = "MySource";
this.TestCaseProvider = (string source) =>
{
VSTestCase[] testCases = new VSTestCase[]
{
CreateTestCase("A/1", MySource, false), CreateTestCase("A/2", MySource),
CreateTestCase("B/1", MySource), CreateTestCase("B/2", MySource, false), CreateTestCase("B/3", MySource, false)
};
return testCases;
};
this.Executor.RunTests(
new string[] { MySource },
this.RunContext,
this.FrameworkHandle
);
foreach (IBoostTestRunner runner in this.RunnerFactory.ProvisionedRunners)
{
// One runner per source is provisioned for the available source
Assert.That(this.RunnerFactory.ProvisionedRunners.Count, Is.EqualTo(1));
Assert.That(runner, Is.TypeOf<MockBoostTestRunner>());
MockBoostTestRunner testRunner = (MockBoostTestRunner)runner;
//Ensure that the source is that specified
Assert.That(testRunner.Source, Is.EqualTo(MySource));
// The same runner is run for every test that will be executed, in this case 5
Assert.That(testRunner.RunCount, Is.EqualTo(5));
// Check that only the enabled tests are run
Assert.That(testRunner.ExecutionArgs[0].Arguments.Tests[0], Is.EqualTo("A/1"));
Assert.That(testRunner.ExecutionArgs[1].Arguments.Tests[0], Is.EqualTo("A/2"));
Assert.That(testRunner.ExecutionArgs[2].Arguments.Tests[0], Is.EqualTo("B/1"));
Assert.That(testRunner.ExecutionArgs[3].Arguments.Tests[0], Is.EqualTo("B/2"));
Assert.That(testRunner.ExecutionArgs[4].Arguments.Tests[0], Is.EqualTo("B/3"));
}
}