public void TestChainOfCommandFails(List <ICommand <MyContext> > commands, int visitedCount) { MyContext context = new MyContext(); ChainOfCommand <MyContext> c = new ChainOfCommand <MyContext>(commands); Assert.AreEqual(IResult.Failed, c.Execute(context)); Assert.AreEqual(visitedCount, context.accessed.Count); }
public void TestChainOfCommandFailsNullContext(List <ICommand <MyContext> > commands, int visitedCount) { ChainOfCommand <MyContext> c = new ChainOfCommand <MyContext>(commands); Assert.AreEqual(IResult.Failed, c.Execute(null)); }