public async Task AllPassing() { TextImporter sut = new TextImporter(); var tr = await TestRunSetup.BuildTestRun(); tr.Name = "Sample Test Run"; var textReport = tr.WriteToText(false); var generatedTestRun = sut.ImportText(textReport); var newTextReport = generatedTestRun.WriteToText(false); System.IO.File.WriteAllText("textReport.txt", textReport); System.IO.File.WriteAllText("newTextReport.txt", newTextReport); newTextReport.ValidateToTemplate(textReport); }
public async Task AllPassing() { var factory = new CoreFactory(); xB.CurrentRun = factory.CreateTestRunBuilder("Test Run"); var tr = await TestRunSetup.BuildTestRun(); var reasons = new List <string>() { "Removing", "Building", "Untested", "Ready", "Defining" }; xB.CurrentRun.TestRun.UpdateParentReasonsAndStats(reasons); this.ValidateTestResuls(tr); }
public async Task AllPassing() { var factory = new CoreFactory(); xB.CurrentRun = factory.CreateTestRunBuilder("Test Run"); var tr = await TestRunSetup.BuildTestRun(); var reasons = new List <string>() { "Removing", "Building", "Untested", "Ready", "Defining" }; var features = new List <string>() { }; xB.Complete("xBDDConfig.json", features, (message) => { Logger.LogMessage(message); }); }
public async Task OneFailingFirstStepTest() { var failingStepIds = new List <string>() { "1-1-1-1" }; var tr = await TestRunSetup.BuildTestRun(failingStepIds); var statsOverrides = new Dictionary <string, OutcomeStats>(); statsOverrides.Add("testrun-capabilities", new OutcomeStats() { Total = 3, Passed = 2, Skipped = 0, Failed = 1 }); statsOverrides.Add("testrun-features", new OutcomeStats() { Total = 9, Passed = 8, Skipped = 0, Failed = 1 }); statsOverrides.Add("testrun-scenarios", new OutcomeStats() { Total = 27, Passed = 26, Skipped = 0, Failed = 1 }); statsOverrides.Add("testrun-steps", new OutcomeStats() { Total = 81, Passed = 78, Skipped = 2, Failed = 1 }); statsOverrides.Add("capability 1-features", new OutcomeStats() { Total = 3, Passed = 2, Skipped = 0, Failed = 1 }); statsOverrides.Add("capability 1-scenarios", new OutcomeStats() { Total = 9, Passed = 8, Skipped = 0, Failed = 1 }); statsOverrides.Add("capability 1-steps", new OutcomeStats() { Total = 27, Passed = 24, Skipped = 2, Failed = 1 }); statsOverrides.Add("feature 1 1-scenarios", new OutcomeStats() { Total = 3, Passed = 2, Skipped = 0, Failed = 1 }); statsOverrides.Add("feature 1 1-steps", new OutcomeStats() { Total = 9, Passed = 6, Skipped = 2, Failed = 1 }); statsOverrides.Add("scenario 1 1 1-steps", new OutcomeStats() { Total = 3, Passed = 0, Skipped = 2, Failed = 1 }); var outcomeOverrides = new Dictionary <string, Outcome>(); outcomeOverrides.Add("testrun", Outcome.Failed); outcomeOverrides.Add("capability 1", Outcome.Failed); outcomeOverrides.Add("feature 1 1", Outcome.Failed); outcomeOverrides.Add("scenario 1 1 1", Outcome.Failed); outcomeOverrides.Add("step-1-1-1-1", Outcome.Failed); outcomeOverrides.Add("step-1-1-1-2", Outcome.Skipped); outcomeOverrides.Add("step-1-1-1-3", Outcome.Skipped); this.ValidateTestResuls(tr, statsOverrides, outcomeOverrides); }
public async Task AllPassing() { var tr = await TestRunSetup.BuildTestRun(); this.ValidateTestResuls(tr); }
public async Task OneFailingFirstStepTest() { var factory = new CoreFactory(); xB.CurrentRun = factory.CreateTestRunBuilder("Test Run"); var skippedScenarioIds = new Dictionary <string, string>(); skippedScenarioIds.Add("010101", "Building"); skippedScenarioIds.Add("010102", "Untested"); skippedScenarioIds.Add("010201", "Untested"); skippedScenarioIds.Add("010202", "Ready"); skippedScenarioIds.Add("010301", "Ready"); skippedScenarioIds.Add("010302", "Defining"); skippedScenarioIds.Add("020101", "Building"); skippedScenarioIds.Add("020201", "Untested"); skippedScenarioIds.Add("020301", "Ready"); var tr = await TestRunSetup.BuildTestRun(null, skippedScenarioIds); var reasons = new List <string>() { "Removing", "Building", "Untested", "Ready", "Defining" }; xB.CurrentRun.TestRun.UpdateParentReasonsAndStats(reasons); var statsOverrides = new Dictionary <string, Dictionary <string, int> >(); statsOverrides.Add("Testrun-capabilities", new Dictionary <string, int>() { { "Defining", 1 }, { "Ready", 1 } }); statsOverrides.Add("Testrun-features", new Dictionary <string, int>() { { "Building", 1 }, { "Untested", 2 }, { "Ready", 2 }, { "Defining", 1 } }); statsOverrides.Add("Testrun-scenarios", new Dictionary <string, int>() { { "Building", 2 }, { "Untested", 3 }, { "Ready", 3 }, { "Defining", 1 } }); statsOverrides.Add("Capability 01-features", new Dictionary <string, int>() { { "Untested", 1 }, { "Ready", 1 }, { "Defining", 1 } }); statsOverrides.Add("Capability 01-scenarios", new Dictionary <string, int>() { { "Building", 1 }, { "Untested", 2 }, { "Ready", 2 }, { "Defining", 1 } }); statsOverrides.Add("Capability 02-features", new Dictionary <string, int>() { { "Building", 1 }, { "Untested", 1 }, { "Ready", 1 } }); statsOverrides.Add("Capability 02-scenarios", new Dictionary <string, int>() { { "Building", 1 }, { "Untested", 1 }, { "Ready", 1 } }); statsOverrides.Add("Feature 0101-scenarios", new Dictionary <string, int>() { { "Building", 1 }, { "Untested", 1 } }); statsOverrides.Add("Feature 0102-scenarios", new Dictionary <string, int>() { { "Untested", 1 }, { "Ready", 1 } }); statsOverrides.Add("Feature 0103-scenarios", new Dictionary <string, int>() { { "Ready", 1 }, { "Defining", 1 } }); statsOverrides.Add("Feature 0201-scenarios", new Dictionary <string, int>() { { "Building", 1 } }); statsOverrides.Add("Feature 0202-scenarios", new Dictionary <string, int>() { { "Untested", 1 } }); statsOverrides.Add("Feature 0203-scenarios", new Dictionary <string, int>() { { "Ready", 1 } }); var outcomeOverrides = new Dictionary <string, string>(); outcomeOverrides.Add("Testrun", "Defining"); outcomeOverrides.Add("Capability 01", "Defining"); outcomeOverrides.Add("Capability 02", "Ready"); outcomeOverrides.Add("Feature 0101", "Untested"); outcomeOverrides.Add("Feature 0102", "Ready"); outcomeOverrides.Add("Feature 0103", "Defining"); outcomeOverrides.Add("Scenario 010101", "Building"); outcomeOverrides.Add("Scenario 010102", "Untested"); outcomeOverrides.Add("Scenario 010201", "Untested"); outcomeOverrides.Add("Scenario 010202", "Ready"); outcomeOverrides.Add("Scenario 010301", "Ready"); outcomeOverrides.Add("Scenario 010302", "Defining"); outcomeOverrides.Add("Feature 0201", "Building"); outcomeOverrides.Add("Feature 0202", "Untested"); outcomeOverrides.Add("Feature 0203", "Ready"); outcomeOverrides.Add("Scenario 020101", "Building"); outcomeOverrides.Add("Scenario 020201", "Untested"); outcomeOverrides.Add("Scenario 020301", "Ready"); this.ValidateTestResuls(tr, statsOverrides, outcomeOverrides); }