-
Notifications
You must be signed in to change notification settings - Fork 0
Enhance test coverage #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
f4fabdb
Add `ConsoleTest` and `ConsoleReal` classes implementing `IConsole`.
3rikF e4104d6
Removed `DebugFlag` (whose name was wrong anyway).
3rikF d8563d0
Replace `WithDebugMode` with `WithTestMode`
3rikF 845fe95
This commit introduces new tests in `ProgressProxyExtensionsTests.cs`…
3rikF 67671f9
changed constructor from array to enumerable
3rikF 3b66f4d
simplified code
3rikF 68b9af7
Moved `ConsoleInterceptor` to own file.
3rikF 28c5177
Made Ctor parameters nullable again
3rikF 435cd92
Allowed empty iterations.
3rikF 7d7da06
This commit introduces new test methods in `ConsoleProgressHandlerTes…
3rikF aeb8fa1
Improve null safety in ConsoleProgressHandler test
3rikF a3b6b6d
Update package version from 1.0.2 to 1.0.3
3rikF 50f1dbb
Update dotnet-linux.yml
3rikF 3686d5c
adjusted two tests to run on windows as well as linux
3rikF 2d948aa
enhanced readability
3rikF d560c71
Update ConsoleProgressBar/ConsoleProgressBar/ConsoleTest.cs
3rikF 1869cf5
Fix Linux output issue in ConsoleProgressHandlerTests
3rikF File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| | ||
| using System.Text; | ||
|
|
||
| //----------------------------------------------------------------------------------------------------------------------------------------- | ||
| namespace ConsoleProgressBar; | ||
|
|
||
| //--- implement everything using the console itself --- | ||
| public sealed class ConsoleReal : IConsole | ||
| { | ||
| public Encoding OutputEncoding | ||
| { | ||
| get => Console.OutputEncoding; | ||
| set => Console.OutputEncoding = value; | ||
| } | ||
|
|
||
| public ConsoleColor ForegroundColor | ||
| { | ||
| get => Console.ForegroundColor; | ||
| set => Console.ForegroundColor = value; | ||
| } | ||
|
|
||
| public ConsoleColor BackgroundColor | ||
| { | ||
| get => Console.BackgroundColor; | ||
| set => Console.BackgroundColor = value; | ||
| } | ||
|
|
||
| public int WindowWidth | ||
| => Console.WindowWidth; | ||
|
|
||
| public int CursorLeft | ||
| { | ||
| get => Console.CursorLeft; | ||
| set => Console.CursorLeft = value; | ||
| } | ||
|
|
||
| public int CursorTop | ||
| { | ||
| get => Console.CursorTop; | ||
| set => Console.CursorTop = value; | ||
| } | ||
|
|
||
| public bool CursorVisible | ||
| { | ||
| //get => Console.CursorVisible; | ||
| set => Console.CursorVisible = value; | ||
| } | ||
|
|
||
| public void SetCursorPosition(int left, int top) => Console.SetCursorPosition(left, top); | ||
| public void Write(char value) => Console.Write(value); | ||
| public void Write(string value) => Console.Write(value); | ||
| public void WriteLine() => Console.WriteLine(); | ||
| public void WriteLine(string value) => Console.WriteLine(value); | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| | ||
| using System.Text; | ||
|
|
||
| //----------------------------------------------------------------------------------------------------------------------------------------- | ||
| namespace ConsoleProgressBar; | ||
|
|
||
| //----------------------------------------------------------------------------------------------------------------------------------------- | ||
| public sealed class ConsoleTest : IConsole | ||
| { | ||
| internal const int DEBUG_CONSOLE_WIDTH = 80; | ||
|
|
||
| public Encoding OutputEncoding | ||
| { | ||
| get => Console.OutputEncoding; | ||
| set => Console.OutputEncoding = value; | ||
| } | ||
|
|
||
| public void Write(char value) | ||
| => Console.Write(value); | ||
|
|
||
| public void Write(string value) | ||
| => Console.Write(value); | ||
|
|
||
| public void WriteLine() | ||
| => Console.WriteLine(); | ||
|
|
||
| public void WriteLine(string value) | ||
| => Console.WriteLine(value); | ||
|
|
||
| //--- not supported while testing console --- | ||
|
|
||
| /// <summary> | ||
| /// Will not create an exception when called with the real console during tests, | ||
| /// but will not change the color either. | ||
| /// </summary> | ||
| public ConsoleColor BackgroundColor | ||
| { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Will not create an exception when called with the real console during tests, | ||
| /// but will not change the color either. | ||
| /// </summary> | ||
| public ConsoleColor ForegroundColor | ||
| { get; set; } | ||
|
|
||
| public int WindowWidth => DEBUG_CONSOLE_WIDTH; | ||
| public int CursorLeft { get; set; } = 0; | ||
| public int CursorTop { get; set; } = 0; | ||
|
|
||
| public bool CursorVisible { set { } } | ||
|
|
||
| public void SetCursorPosition(int left, int top) | ||
| { } | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| | ||
| // ignore spelling: bg | ||
|
|
||
| using System.Text; | ||
|
|
||
| //----------------------------------------------------------------------------------------------------------------------------------------- | ||
| namespace ConsoleProgressBar; | ||
|
|
||
| //----------------------------------------------------------------------------------------------------------------------------------------- | ||
| public interface IConsole | ||
| { | ||
| Encoding OutputEncoding | ||
| { get; set;} | ||
|
|
||
| int WindowWidth | ||
| { get; /*set;*/ } | ||
|
|
||
| int CursorLeft | ||
| { get; set; } | ||
|
|
||
| int CursorTop | ||
| { get; set; } | ||
|
|
||
| bool CursorVisible | ||
| { /*get;*/ set; } | ||
|
|
||
| ConsoleColor ForegroundColor | ||
| { get; set; } | ||
|
|
||
| ConsoleColor BackgroundColor | ||
| { get; set; } | ||
|
|
||
| void Write(char value); | ||
| void Write(string value); | ||
|
|
||
| void WriteLine(); | ||
| void WriteLine(string value); | ||
|
|
||
| void SetCursorPosition(int left, int top); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.