Exemple #1
0
 internal TestResultAdaptor(RemoteTestResultData result, RemoteTestResultDataWithTestData allData)
 {
     Test              = new TestAdaptor(allData.tests.First(t => t.id == result.testId));
     Name              = result.name;
     FullName          = result.fullName;
     ResultState       = result.resultState;
     TestStatus        = ParseTestStatus(result.testStatus);
     Duration          = result.duration;
     StartTime         = result.startTime;
     EndTime           = result.endTime;
     Message           = result.message;
     StackTrace        = result.stackTrace;
     AssertCount       = result.assertCount;
     FailCount         = result.failCount;
     PassCount         = result.passCount;
     SkipCount         = result.skipCount;
     InconclusiveCount = result.inconclusiveCount;
     HasChildren       = result.hasChildren;
     Output            = result.output;
     Children          = result.childrenIds.Select(childId => new TestResultAdaptor(allData.results.First(r => r.testId == childId), allData)).ToArray();
     if (!string.IsNullOrEmpty(result.xml))
     {
         m_Node = TNode.FromXml(result.xml);
     }
 }
Exemple #2
0
        public ITestAdaptor Create(ITest test)
        {
            var uniqueName = test.GetUniqueName();

            if (m_TestAdaptorCache.ContainsKey(uniqueName))
            {
                return(m_TestAdaptorCache[uniqueName]);
            }

            var adaptor = new TestAdaptor(test, test.Tests.Select(Create).ToArray());

            foreach (var child in adaptor.Children)
            {
                (child as TestAdaptor).SetParent(adaptor);
            }
            m_TestAdaptorCache[uniqueName] = adaptor;
            return(adaptor);
        }
 internal TestResultAdaptor(ITestResult result)
 {
     Test              = new TestAdaptor(result.Test);
     Name              = result.Name;
     FullName          = result.FullName;
     ResultState       = result.ResultState.ToString();
     TestStatus        = ParseTestStatus(result.ResultState.Status);
     Duration          = result.Duration;
     StartTime         = result.StartTime;
     EndTime           = result.EndTime;
     Message           = result.Message;
     StackTrace        = result.StackTrace;
     AssertCount       = result.AssertCount;
     FailCount         = result.FailCount;
     PassCount         = result.PassCount;
     SkipCount         = result.SkipCount;
     InconclusiveCount = result.InconclusiveCount;
     HasChildren       = result.HasChildren;
     Output            = result.Output;
     Children          = result.Children.Select(child => new TestResultAdaptor(child)).ToArray();
     m_Node            = result.ToXml(true);
 }