コード例 #1
0
        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),
            });
        }
コード例 #2
0
 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);
 }
コード例 #3
0
 public void SendTestResult(MsTestResult testResult)
 {
     TestResult = testResult;
 }