Skip to content

Commit

Permalink
committing tests fixes microsoft#958
Browse files Browse the repository at this point in the history
  • Loading branch information
DineshChirnanchu committed Sep 6, 2019
1 parent 5081873 commit f7bb50c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
Expand Up @@ -49,7 +49,7 @@ public void DiscoverTestsShouldCallInitialize()
{
var manualResetEvent = new ManualResetEvent(false);
var mockTestDiscoveryEventHandler = new Mock<ITestDiscoveryEventsHandler2>();
this.mockDiscoveryManager.Setup(o => o.Initialize(Enumerable.Empty<string>(), mockTestDiscoveryEventHandler.Object)).Callback(
this.mockDiscoveryManager.Setup(o => o.Initialize(Enumerable.Empty<string>(), null)).Callback(
() => manualResetEvent.Set());

var discoveryCriteria = new DiscoveryCriteria(new[] { "test.dll" }, 1, string.Empty);
Expand Down
Expand Up @@ -51,7 +51,7 @@ public void StartTestRunShouldCallInitialize()
var mockTestMessageEventHandler = new Mock<ITestMessageEventHandler>();
this.inProcessProxyExecutionManager.StartTestRun(testRunCriteria, null);

this.mockExecutionManager.Verify(o => o.Initialize(Enumerable.Empty<string>(), mockTestMessageEventHandler.Object), Times.Once, "StartTestRun should call Initialize if not already initialized");
this.mockExecutionManager.Verify(o => o.Initialize(Enumerable.Empty<string>(), It.IsAny<ITestMessageEventHandler>()), Times.Once, "StartTestRun should call Initialize if not already initialized");
}

[TestMethod]
Expand Down
Expand Up @@ -174,13 +174,12 @@ public void ProcessRequestsVersionCheckShouldLogErrorIfDiagnosticsEnableFails()
public void ProcessRequestsDiscoveryInitializeShouldSetExtensionPaths()
{
var message = this.dataSerializer.SerializePayload(MessageType.DiscoveryInitialize, new[] { "testadapter.dll" });
var mockTestDiscoveryEventHandler = new Mock<ITestDiscoveryEventsHandler2>();
this.ProcessRequestsAsync(this.mockTestHostManagerFactory.Object);

this.SendMessageOnChannel(message);
this.jobQueue.Flush();

this.mockDiscoveryManager.Verify(d => d.Initialize(It.Is<IEnumerable<string>>(paths => paths.Any(p => p.Equals("testadapter.dll"))), mockTestDiscoveryEventHandler.Object));
this.mockDiscoveryManager.Verify(d => d.Initialize(It.Is<IEnumerable<string>>(paths => paths.Any(p => p.Equals("testadapter.dll"))), It.IsAny<ITestDiscoveryEventsHandler2>()));
this.SendSessionEnd();
}

Expand Down Expand Up @@ -219,13 +218,12 @@ public void DiscoveryCompleteShouldSendDiscoveryCompletePayloadOnChannel()
public void ProcessRequestsExecutionInitializeShouldSetExtensionPaths()
{
var message = this.dataSerializer.SerializePayload(MessageType.ExecutionInitialize, new[] { "testadapter.dll" });
var mockTestDiscoveryEventHandler = new Mock<ITestDiscoveryEventsHandler2>();
this.ProcessRequestsAsync(this.mockTestHostManagerFactory.Object);

this.SendMessageOnChannel(message);
this.jobQueue.Flush();

this.mockExecutionManager.Verify(e => e.Initialize(It.Is<IEnumerable<string>>(paths => paths.Any(p => p.Equals("testadapter.dll"))), mockTestDiscoveryEventHandler.Object));
this.mockExecutionManager.Verify(e => e.Initialize(It.Is<IEnumerable<string>>(paths => paths.Any(p => p.Equals("testadapter.dll"))), It.IsAny<ITestMessageEventHandler>()));
this.SendSessionEnd();
}

Expand Down

0 comments on commit f7bb50c

Please sign in to comment.