public static string GetTestJsonData(BDTestRunDescriptor bdTestRunDescriptor) { var scenarios = BDTestUtil.GetScenarios(); var testTimer = GetTestTimer(scenarios); var dataToOutput = new BDTestOutputModel { Id = BDTestUtil.GetCurrentReportId, Environment = bdTestRunDescriptor?.Environment ?? BDTestSettings.Environment, Tag = bdTestRunDescriptor?.Tag ?? BDTestSettings.Tag, BranchName = bdTestRunDescriptor?.BranchName ?? BDTestSettings.BranchName, MachineName = Environment.MachineName, Scenarios = scenarios, TestTimer = testTimer, NotRun = BDTestUtil.GetNotRunScenarios(), Version = BDTestVersionHelper.CurrentVersion }; var settings = new JsonSerializerSettings { PreserveReferencesHandling = PreserveReferencesHandling.Objects }; return(JsonConvert.SerializeObject(dataToOutput, Formatting.Indented, settings)); }
public void Test() { SuccessTest(); NotRunTest1(); NotRunTest2(); NotRunTest3(); var notRunScenarios = BDTestUtil.GetNotRunScenarios(); Assert.That(notRunScenarios.Count, Is.EqualTo(3)); Assert.That(notRunScenarios.Any(scenario => scenario.GetScenarioText() == "Custom NotRunTest1")); Assert.That(notRunScenarios.Any(scenario => scenario.GetScenarioText() == "Custom NotRunTest2")); Assert.That(notRunScenarios.Any(scenario => scenario.GetScenarioText() == "Custom NotRunTest3")); Assert.That(notRunScenarios.All(scenario => scenario.GetStoryText() == @"As a BDTest developer I want to make sure that BDTest flags tests not executed So that consumers aren't missing any test coverage accidentally ")); }