Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubch1 committed May 25, 2020
1 parent 69340a5 commit e23d24d
Showing 1 changed file with 33 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,47 @@ public void Cleanup()
this.vstestConsoleWrapper?.EndSession();
}

[TestMethod]
//[TestMethod]
//[NetFullTargetFrameworkDataSource]
[NetCoreTargetFrameworkDataSource]
public void RunAllTests(RunnerInfo runnerInfo)
//[NetCoreTargetFrameworkDataSource]
//public void RunAllTests(RunnerInfo runnerInfo)
//{
// AcceptanceTestBase.SetTestEnvironment(this.testEnvironment, runnerInfo);
// this.Setup();

// this.vstestConsoleWrapper.RunTests(this.GetTestAssemblies().Take(1), this.GetCodeCoverageRunSettings(), this.runEventHandler);
// this.vstestConsoleWrapper.RunTests(this.GetTestAssemblies().Skip(1), this.GetCodeCoverageRunSettings(), this.runEventHandler);

// // Assert
// Assert.AreEqual(6, this.runEventHandler.TestResults.Count);
// Assert.AreEqual(2, this.runEventHandler.Attachments.Count);
// Assert.AreEqual(2, this.runEventHandler.TestResults.Count(t => t.Outcome == TestOutcome.Passed));
// Assert.AreEqual(2, this.runEventHandler.TestResults.Count(t => t.Outcome == TestOutcome.Failed));
// Assert.AreEqual(2, this.runEventHandler.TestResults.Count(t => t.Outcome == TestOutcome.Skipped));

// this.vstestConsoleWrapper.FinalizeMultiTestRuns(runEventHandler.Attachments, multiTestRunsFinalizationEventHandler);
// Assert.AreEqual(1, this.multiTestRunsFinalizationEventHandler.Attachments.Count);
//}

[TestMethod]
public void RunAllTests()
{
RunnerInfo runnerInfo = new RunnerInfo(AcceptanceTestBase.DesktopTargetFramework, AcceptanceTestBase.DesktopTargetFramework);
AcceptanceTestBase.SetTestEnvironment(this.testEnvironment, runnerInfo);
this.Setup();

this.vstestConsoleWrapper.RunTests(this.GetTestAssemblies().Take(1), this.GetCodeCoverageRunSettings(), this.runEventHandler);
this.vstestConsoleWrapper.RunTests(this.GetTestAssemblies().Skip(1), this.GetCodeCoverageRunSettings(), this.runEventHandler);
//this.vstestConsoleWrapper.RunTests(this.GetTestAssemblies().Skip(1), this.GetCodeCoverageRunSettings(), this.runEventHandler);

// Assert
Assert.AreEqual(6, this.runEventHandler.TestResults.Count);
Assert.AreEqual(2, this.runEventHandler.Attachments.Count);
Assert.AreEqual(2, this.runEventHandler.TestResults.Count(t => t.Outcome == TestOutcome.Passed));
Assert.AreEqual(2, this.runEventHandler.TestResults.Count(t => t.Outcome == TestOutcome.Failed));
Assert.AreEqual(2, this.runEventHandler.TestResults.Count(t => t.Outcome == TestOutcome.Skipped));

this.vstestConsoleWrapper.FinalizeMultiTestRuns(runEventHandler.Attachments, multiTestRunsFinalizationEventHandler);
Assert.AreEqual(1, this.multiTestRunsFinalizationEventHandler.Attachments.Count);
Assert.AreEqual(3, this.runEventHandler.TestResults.Count);
Assert.AreEqual(1, this.runEventHandler.Attachments.Count);
//Assert.AreEqual(2, this.runEventHandler.TestResults.Count(t => t.Outcome == TestOutcome.Passed));
//Assert.AreEqual(2, this.runEventHandler.TestResults.Count(t => t.Outcome == TestOutcome.Failed));
//Assert.AreEqual(2, this.runEventHandler.TestResults.Count(t => t.Outcome == TestOutcome.Skipped));

//this.vstestConsoleWrapper.FinalizeMultiTestRuns(runEventHandler.Attachments, multiTestRunsFinalizationEventHandler);
//Assert.AreEqual(1, this.multiTestRunsFinalizationEventHandler.Attachments.Count);
}

[TestMethod]
Expand Down

0 comments on commit e23d24d

Please sign in to comment.