public void SendTestResult(TestResult testResult) { if (testResult == null) { throw new ArgumentNullException(nameof(testResult)); } if (testResult.StartTime == default(DateTimeOffset) && testResult.Test.FullyQualifiedName != null) { TestState state; _runningTests.TryRemove(testResult.Test.FullyQualifiedName, out state); testResult.StartTime = state.StartTime; } if (testResult.EndTime == default(DateTimeOffset)) { testResult.EndTime = DateTimeOffset.Now; } Stream.Send(new Message { MessageType = "TestExecution.TestResult", Payload = JToken.FromObject(testResult), }); }
protected static void AssertAreEqual(MsTestResult expected, MsTestResult actual) { Assert.That(actual, Is.Not.Null); Assert.AreEqual(expected.StartTime, actual.StartTime); Assert.AreEqual(expected.EndTime, actual.EndTime); Assert.AreEqual(expected.Duration, actual.Duration); Assert.AreEqual(expected.DisplayName, actual.DisplayName); Assert.AreEqual(expected.ComputerName, actual.ComputerName); Assert.AreEqual(expected.ErrorMessage, actual.ErrorMessage); Assert.AreEqual(expected.ErrorStackTrace, actual.ErrorStackTrace); Assert.AreEqual(expected.Outcome, actual.Outcome); }
public void SendTestResult(MsTestResult testResult) { TestResult = testResult; }