File tree Expand file tree Collapse file tree 4 files changed +48
-8
lines changed Expand file tree Collapse file tree 4 files changed +48
-8
lines changed Original file line number Diff line number Diff line change 1010
1111 <ItemGroup >
1212 <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 17.1.0" />
13+ <PackageReference Include =" Moq" Version =" 4.7.145" />
1314 <PackageReference Include =" NUnit" Version =" 3.13.3" />
1415 <PackageReference Include =" NUnit3TestAdapter" Version =" 4.2.1" />
1516 <PackageReference Include =" NUnit.Analyzers" Version =" 3.3.0" />
Original file line number Diff line number Diff line change 1+ using InEngine . Commands . Sample ;
2+ using InEngine . Core . IO ;
3+ using InEngineTesting ;
4+ using Moq ;
5+
6+ namespace InEngine . Commands . Test . Sample ;
7+
8+ public class MinimalTest : TestBase < Minimal >
9+ {
10+ [ Test ]
11+ public async Task ShouldSucceed ( )
12+ {
13+ const string expected = "This is an example of a minimal command." ;
14+ var mockWrite = new Mock < IConsoleWrite > ( ) ;
15+ Subject . Write = mockWrite . Object ;
16+
17+ await Subject . RunAsync ( ) ;
18+
19+ mockWrite . Verify ( x => x . Info ( expected ) , Times . Once ( ) ) ;
20+ Assert . Pass ( ) ;
21+ }
22+ }
Original file line number Diff line number Diff line change 1+ using InEngine . Commands . Sample ;
2+ using InEngine . Core . IO ;
3+ using InEngineTesting ;
4+ using Moq ;
5+
6+ namespace InEngine . Commands . Test . Sample ;
7+
8+ public class SayHelloTest : TestBase < SayHello >
9+ {
10+ [ Test ]
11+ public async Task ShouldSayHelloTest ( )
12+ {
13+ const string expected = "hello" ;
14+ var mockWrite = new Mock < IConsoleWrite > ( ) ;
15+ Subject . Write = mockWrite . Object ;
16+
17+ await Subject . RunAsync ( ) ;
18+
19+ mockWrite . Verify ( x => x . Info ( expected ) , Times . Once ( ) ) ;
20+ Assert . Pass ( ) ;
21+ }
22+ }
Original file line number Diff line number Diff line change 33
44namespace InEngine . Commands . Sample ;
55
6- /*
7- * The AbstractCommand class adds functionality, including a logger and a
8- * progress bar.
9- */
6+ /// <summary>
7+ /// The AbstractCommand class adds functionality, including a logger and a progress bar.
8+ /// </summary>
109public class ShowProgress : AbstractCommand
1110{
12- /*
13- * Note that the override keyword is necessary in the Run method
14- * signature as the base class method is virtual.
15- */
1611 public override async Task RunAsync ( )
1712 {
1813 // Define the ticks (aka steps) for the command...
You can’t perform that action at this time.
0 commit comments