Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Microsoft/vstest into fas…
Browse files Browse the repository at this point in the history
…tfilterfixes
  • Loading branch information
AbhitejJohn committed Oct 4, 2017
2 parents 20f8b17 + b5694d4 commit e1b4e4e
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -472,15 +472,18 @@ public void StartTestRunShouldCallHandleLogMessageOnTestMessage()
() =>
{
this.mockDataSerializer.Setup(ds => ds.DeserializeMessage(It.IsAny<string>())).Returns(completeMessage);
this.mockDataSerializer.Setup(ds => ds.DeserializePayload<TestRunCompletePayload>(completeMessage)).Returns(completePayload);
waitHandle.Set();
this.mockDataSerializer.Setup(ds => ds.DeserializePayload<TestRunCompletePayload>(completeMessage)).Callback(() => { waitHandle.Set(); })
.Returns(completePayload);
});

this.testRequestSender.StartTestRun(runCriteria, mockHandler.Object);
waitHandle.WaitOne();

this.mockCommunicationManager.Verify(mc => mc.SendMessage(MessageType.StartTestExecutionWithSources, runCriteria, this.protocolConfig.Version), Times.Once);
this.mockDataSerializer.Verify(ds => ds.DeserializeMessage(It.IsAny<string>()), Times.Exactly(2));
this.mockDataSerializer.Verify(ds => ds.DeserializeMessage(It.IsAny<string>()), Times.AtLeast(2));

// Asserting that 'StartTestRun" should have been completed, & invoked only once
this.mockDataSerializer.Verify(ds => ds.DeserializePayload<TestRunCompletePayload>(completeMessage), Times.Exactly(1));
mockHandler.Verify(mh => mh.HandleLogMessage(payload.MessageLevel, payload.Message), Times.Once);
mockHandler.Verify(mh => mh.HandleRawMessage(rawMessage), Times.AtLeastOnce);
}
Expand Down

0 comments on commit e1b4e4e

Please sign in to comment.