示例#1
0
    public void Light_UsesDimmerColor()
    {
        using var mockConsole = new FakeConsole();

        Write.Light("Light");

        Assert.Equal($"{Dim}Light{Reset}{NL}", mockConsole.GetOuput());
    }
示例#2
0
    public void Line_UsesStandardColor()
    {
        using var mockConsole = new FakeConsole();

        Write.Line("Line");

        Assert.Equal($"Line{NL}", mockConsole.GetOuput());
    }
示例#3
0
    public void Empty_WritesEmptyLine()
    {
        using var mockConsole = new FakeConsole();

        Write.Empty();

        Assert.Equal($"{NL}", mockConsole.GetOuput());
    }
示例#4
0
    public void Header_WritesAHeader()
    {
        using var mockConsole = new FakeConsole();

        Write.Header("Header");

        Assert.Equal($"{NL}Header{NL}------{NL}", mockConsole.GetOuput());
    }
示例#5
0
    public void Error_WritesErrorMessage()
    {
        using var mockConsole = new FakeConsole();

        Write.Error("MyError");

        Assert.Equal($"{Red}ERROR: MyError{Reset}{NL}", mockConsole.GetOuput());
    }
示例#6
0
    public void WithNL_WritesNewLines(bool before, bool after, string expected)
    {
        using var mockConsole = new FakeConsole();

        Write.WithNL("Line", before, after);

        Assert.Equal(expected, mockConsole.GetOuput());
    }
示例#7
0
    public void Warn_WritesWarningMessage()
    {
        using var mockConsole = new FakeConsole();

        Write.Warn("MyWarning");

        Assert.Equal($"{Yellow}WARNING: MyWarning{Reset}{NL}", mockConsole.GetOuput());
    }
示例#8
0
    public void Success_UsesSuccessColor()
    {
        using var mockConsole = new FakeConsole();

        Write.Success("Great success!");

        Assert.Equal($"{Green}Great success!{Reset}{NL}", mockConsole.GetOuput());
    }
示例#9
0
    public void Note_UsesNotificationColor()
    {
        using var mockConsole = new FakeConsole();

        Write.Note("Note");

        Assert.Equal($"{Yellow}Note{Reset}{NL}", mockConsole.GetOuput());
    }
示例#10
0
    public void ErrorExit_WritesExtraLine()
    {
        using var mockConsole = new FakeConsole();

        Write.ErrorExit("MyError");

        Assert.Equal(
            $"{Red}ERROR: MyError{Reset}{NL}{Red}Exiting{Reset}{NL}",
            mockConsole.GetOuput()
            );
    }
示例#11
0
    public void MethodSupportingMultipleLines_WritesMultipleLines()
    {
        using var mockConsole = new FakeConsole();

        Write.Light("1", "2", "3");

        Assert.Equal(
            $"{Dim}1{Reset}{NL}{Dim}2{Reset}{NL}{Dim}3{Reset}{NL}",
            mockConsole.GetOuput()
            );
    }