public void Send(Message message)
 {
     lock (_writer)
     {
         try
         {
             Trace.TraceInformation("[ReportingChannel]: Send({0})", message);
             _writer.Write(JsonConvert.SerializeObject(message));
         }
         catch (Exception ex)
         {
             Trace.TraceInformation("[ReportingChannel]: Error sending {0}", ex);
             throw;
         }
     }
 }
Beispiel #2
0
        private static bool TestStarted(Message message, string name)
        {
            if (!string.Equals("TestExecution.TestStarted", message.MessageType))
            {
                return false;
            }

            if (!string.Equals(name, message.Payload.ToObject<Test>().DisplayName))
            {
                return false;
            }

            return true;
        }
Beispiel #3
0
        private static bool TestPassed(Message message, string name)
        {
            if (!string.Equals("TestExecution.TestResult", message.MessageType))
            {
                return false;
            }

            var result = message.Payload.ToObject<TestResult>();
            if (!string.Equals(name, result.Test.DisplayName))
            {
                return false;
            }

            if (TestOutcome.Passed != result.Outcome)
            {
                return false;
            }

            return true;
        }
Beispiel #4
0
        private static bool TestFound(Message message, string name)
        {
            if (!string.Equals("TestDiscovery.TestFound", message.MessageType))
            {
                return false;
            }

            if (!string.Equals(name, message.Payload.ToObject<Test>().DisplayName))
            {
                return false;
            }

            return true;
        }