Skip to content

What is the best way to use AnsiConsole in Unit Tests? #831

Answered by patriksvensson
buzzfrog asked this question in Q&A
Discussion options

You must be logged in to vote

@buzzfrog Take a look at TestConsole (which implements IAnsiConsole) in the Spectre.Console.Testing NuGet package. This is what Spectre.Console uses for it's own tests as well.

Example of usage:

public void Should_Clear_Screen(bool home, string expected)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@buzzfrog
Comment options

Answer selected by buzzfrog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants