Skip to content

Commit

Permalink
Solve PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mg-diego committed Oct 6, 2023
1 parent 0193d50 commit 3ee1e31
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions samples/TestWare.Samples.MongoDB/Hook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static void BeforeFeature(FeatureContext featureContext)
var tags = featureContext.FeatureInfo.Tags;

_lifeCycle.BeginTestSuite(name);
_testReport.CreateFeature(name, tags);
_testReport?.CreateFeature(name, tags);
}

[AfterFeature]
Expand All @@ -45,7 +45,7 @@ public void BeforeScenario(FeatureContext featureContext, ScenarioContext scenar

var description = scenarioContext.ScenarioInfo.Description ?? "";
var scenarioTags = scenarioContext.ScenarioInfo.Tags;
_testReport.CreateTestCase(name, description, scenarioTags);
_testReport?.CreateTestCase(name, description, scenarioTags);

_testContext.WriteLine("----------------------------------------- \r\n");
_testContext.WriteLine($"Feature: {featureContext.FeatureInfo.Title}");
Expand All @@ -62,7 +62,7 @@ public void BeforeScenario(FeatureContext featureContext, ScenarioContext scenar
[AfterScenario]
public void AfterScenario()
{
_testReport.SetTestcaseOutcome(_testContext.CurrentTestOutcome);
_testReport?.SetTestcaseOutcome(_testContext.CurrentTestOutcome);
_lifeCycle.EndTestCase();
}

Expand All @@ -77,15 +77,15 @@ public static void BeforeTestRun()
public static void AfterTestRun()
{
_lifeCycle.EndTestExecution();
_testReport.CreateTestReportFile();
_testReport?.CreateTestReportFile();
}

[BeforeStep]
public void BeforeStep(ScenarioContext scenarioContext)
{
var name = scenarioContext.CurrentScenarioBlock.ToString();
var description = scenarioContext.StepContext.StepInfo.Text;
_testReport.CreateStep(name, description);
_testReport?.CreateStep(name, description);

var stepId = $"{_stepCounter:00} {description}";
_stepCounter++;
Expand All @@ -100,7 +100,7 @@ public void AfterStep(ScenarioContext scenarioContext)

foreach (var evidence in evidencesPath)
{
_testReport.AddScreenshotToStep(evidence);
_testReport?.AddScreenshotToStep(evidence);
_testContext.AddResultFile(evidence);
}
}
Expand Down

0 comments on commit 3ee1e31

Please sign in to comment.