protected void AssertsTestAddFinishedTest(TimeSpan executionTime, TestFinishedInfo info)
        {
            var assemblyLocation = "abc.dll";
            var sut = new Result(assemblyLocation);

            Assert.Empty(sut.FinishedTests);

            sut.AddFinishedTest(info);
            Assert.Equal(1, sut.Total);
#if NET35
            Assert.Equal(1, sut.FinishedTests.Count);
#else
            Assert.Single(sut.FinishedTests);
#endif
            Assert.Contains(info, sut.FinishedTests);
            Assert.Equal(executionTime, sut.ExecutionTime);

            var actual = sut.FinishedTests.First();
            Assert.Equal(Convert.ToDecimal(executionTime.TotalSeconds), actual.ExecutionTime);
            Assert.Equal(info.MethodName, actual.MethodName);
            Assert.Equal(info.Output, actual.Output);
            Assert.Equal(info.TestCollectionDisplayName, actual.TestCollectionDisplayName);
            Assert.Equal(info.TestDisplayName, actual.TestDisplayName);
            Assert.Equal(info.TypeName, actual.TypeName);
        }
Exemplo n.º 2
0
        static void OnTestFinished(TestFinishedInfo info)
        {
            lock (consoleLock)
            {
                Console.ForegroundColor = ConsoleColor.Yellow;

                Console.ResetColor();
            }
        }
Exemplo n.º 3
0
        public void OnTestFinished(TestFinishedInfo info)
        {
            var item = new ReportItem
            {
                ThreadName   = _threadName,
                Duration     = (double)info.ExecutionTime,
                TestCase     = info.MethodName,
                TestSuite    = info.TypeName,
                ErrorMessage = "",
                ErrorTrace   = "",
                Status       = "PASSED"
            };

            _reportWriter.AddItemToReport(item);
        }
Exemplo n.º 4
0
        private void TestFinishedHandler(TestFinishedInfo info)
        {
            // Commented out in order not to affect execution time
            //logger.DebugFormat("### TEST METHOD FINISHED: {0} ###", info.TestDisplayName);
            string testName         = info.TestDisplayName;
            int    parenthesisIndex = testName.IndexOf('(');

            if (parenthesisIndex != -1)
            {
                // this is a theory, extract the test name
                testName = testName.Substring(0, parenthesisIndex);
            }

            executedTests.Add($"{testName}");
        }
 public void TestAddFinishedTest(TimeSpan executionTime, TestFinishedInfo info)
 {
     this.AssertsTestAddFinishedTest(executionTime, info);
 }
Exemplo n.º 6
0
 void TestFinished(TestFinishedInfo tfi)
 {
     // ConsoleEx.writeLine( ConsoleColor.Gray, tfi.TestDisplayName );
 }
Exemplo n.º 7
0
 private static void TestFinished(TestFinishedInfo info)
 {
     Console.WriteLine("TestFinished.");
 }