public void TestFinished() { TestableTdNetLogger logger = TestableTdNetLogger.Create(); bool result = logger.TestFinished(null, null, null); Assert.True(result); Assert.True(logger.FoundTests); }
public void ExceptionThrown() { TestableTdNetLogger logger = TestableTdNetLogger.Create(); Exception ex = new Exception("message"); logger.ExceptionThrown(null, ex); Assert.Equal(ex.ToString(), logger.Listener.WriteLine__Lines[0].Key); Assert.Equal(Category.Error, logger.Listener.WriteLine__Lines[0].Value); }
public void TestFailedWithOutput() { TestableTdNetLogger logger = TestableTdNetLogger.Create(); logger.TestFailed("TestName", "TdNetLoggerTests", "TestFailedWithOutput", 1.234, "This is" + Environment.NewLine + "output", null, null, null); Assert.Equal("Output from TestName:", logger.Listener.WriteLine__Lines[0].Key); Assert.Equal(Category.Output, logger.Listener.WriteLine__Lines[0].Value); Assert.Equal(" This is", logger.Listener.WriteLine__Lines[1].Key); Assert.Equal(Category.Output, logger.Listener.WriteLine__Lines[1].Value); Assert.Equal(" output", logger.Listener.WriteLine__Lines[2].Key); Assert.Equal(Category.Output, logger.Listener.WriteLine__Lines[2].Value); }
public void ClassFailed() { TestableTdNetLogger logger = TestableTdNetLogger.Create(); bool result = logger.ClassFailed("TdNetLoggerTests", null, "Message", "StackTrace"); TestResult summary = logger.Listener.TestFinished_Summaries[0]; Assert.Equal(typeof(TdNetLoggerTests), summary.FixtureType); Assert.Equal("Fixture TdNetLoggerTests", summary.Name); Assert.Equal(1, summary.TotalTests); Assert.Equal(TestState.Failed, summary.State); Assert.Equal("Message", summary.Message); Assert.Equal("StackTrace", summary.StackTrace); Assert.True(result); }
public void TestPassed() { TestableTdNetLogger logger = TestableTdNetLogger.Create(); logger.TestPassed("name", "TdNetLoggerTests", "TestPassed", 1.234, null); TestResult summary = logger.Listener.TestFinished_Summaries[0]; Assert.Equal(typeof(TdNetLoggerTests), summary.FixtureType); Assert.Equal(typeof(TdNetLoggerTests).GetMethod("TestPassed"), summary.Method); Assert.Equal("name", summary.Name); Assert.Equal(1, summary.TotalTests); Assert.Equal(TestState.Passed, summary.State); Assert.Equal(new TimeSpan(12340), summary.TimeSpan); Assert.Null(summary.Message); Assert.Null(summary.StackTrace); }