Beispiel #1
0
        public void TestCommandGetsReused()
        {
            commandBinder.Bind(SomeEnum.ONE).To <MarkablePoolCommand> ().Pooled();
            IPool <MarkablePoolCommand> pool = pooledCommandBinder.GetPool <MarkablePoolCommand> ();

            for (int a = 0; a < 10; a++)
            {
                commandBinder.ReactTo(SomeEnum.ONE);
                Assert.AreEqual(a + 1, MarkablePoolCommand.incrementValue);
                Assert.AreEqual(1, pool.instanceCount);
            }
        }
Beispiel #2
0
        public void TestCommandGetsReused()
        {
            commandBinder.Bind(singleSignal).To <MarkablePoolCommand> ().Pooled();
            IPool <MarkablePoolCommand> pool = pooledCommandBinder.GetPool <MarkablePoolCommand> ();

            for (int a = 0; a < 10; a++)
            {
                singleSignal.Dispatch(a);
                Assert.AreEqual(a + 1, MarkablePoolCommand.incrementValue);
                Assert.AreEqual(1, pool.instanceCount);
            }
        }