Skip to content

Commit 17f832a

Browse files
committed
Add some more chain command tests
1 parent a23872c commit 17f832a

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

src/InEngine.Core.Test/Commands/ChainTest.cs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using BeekmanLabs.UnitTesting;
1+
using System.Collections.Generic;
2+
using BeekmanLabs.UnitTesting;
23
using InEngine.Commands;
34
using InEngine.Core.Commands;
45
using InEngine.Core.Exceptions;
@@ -51,5 +52,27 @@ public void ShouldRunChainOfCommandsAndFail()
5152
mockCommand1.Verify(x => x.Run(), Times.Once());
5253
mockCommand2.Verify(x => x.Run(), Times.Never());
5354
}
55+
56+
[Test]
57+
public void ShouldRunChainOfDifferentCommands()
58+
{
59+
Subject.Commands = new List<AbstractCommand>() {
60+
new AlwaysSucceed(),
61+
new Echo() { VerbatimText = "Hello, world!"},
62+
};
63+
64+
Subject.Run();
65+
}
66+
67+
[Test]
68+
public void ShouldRunChainOfDifferentCommandsAsAbstractCommand()
69+
{
70+
Subject.Commands = new[] {
71+
new AlwaysSucceed() as AbstractCommand,
72+
new Echo() { VerbatimText = "Hello, world!"} as AbstractCommand,
73+
};
74+
75+
Subject.Run();
76+
}
5477
}
5578
}

0 commit comments

Comments
 (0)