11using System . Collections . Generic ;
2- using InEngine . Commands ;
32using InEngine . Core . Commands ;
43using InEngine . Core . Exceptions ;
4+ using System . Threading . Tasks ;
5+ using InEngineTesting ;
56using Moq ;
6- using NUnit . Framework ;
77
88namespace InEngine . Core . Test . Commands ;
99
@@ -16,7 +16,7 @@ public void Setup()
1616 }
1717
1818 [ Test ]
19- public void ShouldRunChainOfCommands ( )
19+ public async Task ShouldRunChainOfCommands ( )
2020 {
2121 var mockCommand1 = new Mock < AbstractCommand > ( ) ;
2222 var mockCommand2 = new Mock < AbstractCommand > ( ) ;
@@ -27,7 +27,7 @@ public void ShouldRunChainOfCommands()
2727 } ;
2828 Subject . Commands = commands ;
2929
30- Subject . RunAsync ( ) ;
30+ await Subject . RunAsync ( ) ;
3131
3232 mockCommand1 . Verify ( x => x . RunAsync ( ) , Times . Once ( ) ) ;
3333 mockCommand2 . Verify ( x => x . RunAsync ( ) , Times . Once ( ) ) ;
@@ -47,33 +47,33 @@ public void ShouldRunChainOfCommandsAndFail()
4747 } ;
4848 Subject . Commands = commands ;
4949
50- Assert . That ( Subject . RunAsync , Throws . TypeOf < CommandChainFailedException > ( ) ) ;
50+ Assert . ThrowsAsync < CommandChainFailedException > ( async ( ) => await Subject . RunAsync ( ) ) ;
5151
5252 mockCommand1 . Verify ( x => x . RunAsync ( ) , Times . Once ( ) ) ;
5353 mockCommand2 . Verify ( x => x . RunAsync ( ) , Times . Never ( ) ) ;
5454 }
5555
5656 [ Test ]
57- public void ShouldRunChainOfDifferentCommands ( )
57+ public async Task ShouldRunChainOfDifferentCommands ( )
5858 {
5959 Subject . Commands = new List < AbstractCommand >
6060 {
6161 new AlwaysSucceed ( ) ,
62- new Echo ( ) { VerbatimText = "Hello, world!" } ,
62+ new Echo { VerbatimText = "Hello, world!" } ,
6363 } ;
6464
65- Subject . RunAsync ( ) ;
65+ await Subject . RunAsync ( ) ;
6666 }
6767
6868 [ Test ]
69- public void ShouldRunChainOfDifferentCommandsAsAbstractCommand ( )
69+ public async Task ShouldRunChainOfDifferentCommandsAsAbstractCommand ( )
7070 {
7171 Subject . Commands = new AbstractCommand [ ]
7272 {
7373 new AlwaysSucceed ( ) ,
7474 new Echo ( verbatimText : "Hello, world!" ) ,
7575 } ;
7676
77- Subject . RunAsync ( ) ;
77+ await Subject . RunAsync ( ) ;
7878 }
7979}
0 commit comments