Ejemplo n.º 1
0
    public void TestPassedWithOutput()
    {
        TestableTdNetLogger logger = TestableTdNetLogger.Create();

        logger.TestPassed("TestName", "TdNetLoggerTests", "TestPassedWithOutput", 1.234, "This is" + Environment.NewLine + "output");

        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);
    }
Ejemplo n.º 2
0
    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);
    }