11using System ;
22using System . Collections . Generic ;
33using System . IO ;
4+ using System . Linq ;
45using InEngine . Commands ;
56using InEngine . Core ;
67using InEngine . Core . Commands ;
@@ -12,15 +13,15 @@ namespace InEngine.IntegrationTest
1213{
1314 public class QueuingTest : AbstractCommand
1415 {
15- public void Run ( )
16+ public override void Run ( )
1617 {
1718 var queue = QueueAdapter . Make ( ) ;
1819
1920 queue . ClearPendingQueue ( ) ;
2021 queue . Publish ( new Echo ( ) { VerbatimText = "Core echo command." } ) ;
2122 new Length { } . Run ( ) ;
2223 new Peek { PendingQueue = true } . Run ( ) ;
23- new Consume { Count = 10 } . Run ( ) ;
24+ var consume = new Consume { Count = 1000 } ;
2425
2526 Enqueue . Command ( ( ) => Console . WriteLine ( "Core lambda command." ) )
2627 . Dispatch ( ) ;
@@ -31,6 +32,28 @@ public void Run()
3132 . WithRetries ( 4 )
3233 . Dispatch ( ) ;
3334
35+ Enqueue . Commands ( new [ ] {
36+ new Echo { VerbatimText = "Chain Link 1" } ,
37+ new Echo { VerbatimText = "Chain Link 2" } ,
38+ } ) . Dispatch ( ) ;
39+
40+ Enqueue . Commands ( new List < AbstractCommand > {
41+ new Echo { VerbatimText = "Chain Link A" } ,
42+ new AlwaysFail ( ) ,
43+ new Echo { VerbatimText = "Chain Link C" } ,
44+ } ) . Dispatch ( ) ;
45+
46+ Enqueue . Commands ( new List < AbstractCommand > {
47+ new Echo { VerbatimText = "Chain Link A" } ,
48+ new AlwaysFail ( ) ,
49+ new Echo { VerbatimText = "Chain Link C" } ,
50+ } ) . Dispatch ( ) ;
51+
52+ Enqueue . Commands ( Enumerable . Range ( 0 , 10 ) . Select ( x => new AlwaysSucceed ( ) as AbstractCommand ) . ToList ( ) )
53+ . Dispatch ( ) ;
54+
55+ consume . Run ( ) ;
56+
3457 var queueWriteIntegrationTest = "queueWriteIntegrationTest.txt" ;
3558 var queueAppendIntegrationTest = "queueAppendIntegrationTest.txt" ;
3659 File . Delete ( queueWriteIntegrationTest ) ;
@@ -42,18 +65,8 @@ public void Run()
4265 . WriteOutputTo ( queueWriteIntegrationTest )
4366 . AppendOutputTo ( queueAppendIntegrationTest )
4467 . Dispatch ( ) ;
45- Enqueue . Commands ( new [ ] {
46- new Echo { VerbatimText = "Chain Link 1" } ,
47- new Echo { VerbatimText = "Chain Link 2" } ,
48- } ) . Dispatch ( ) ;
49-
50- Enqueue . Commands ( new List < AbstractCommand > {
51- new Echo { VerbatimText = "Chain Link A" } ,
52- new AlwaysFail ( ) ,
53- new Echo { VerbatimText = "Chain Link C" } ,
54- } ) ;
5568
56- new Consume { Count = 1000 } . Run ( ) ;
69+ consume . Run ( ) ;
5770 }
5871 }
5972}
0 commit comments