예제 #1
0
        public void CanAddMultipleHandlersToEcosystem()
        {
            var ecosystem = TestEco();
            var handler1  = new MockHandler1();
            var handler2  = new MockHandler2();

            ecosystem
            .AddHandlers(handler1, handler2)
            .Update();

            Assert.Equal(1, handler1.Called);
            Assert.Equal(1, handler2.Called);
        }
예제 #2
0
        public void CanClearHandlersFromEcosystemWithEntities()
        {
            var ecosystem = CreateEcosystemWithEntities();
            var handler1  = new MockHandler1();
            var handler2  = new MockHandler2();

            ecosystem
            .AddHandlers(handler1, handler2)
            .ClearHandlers()
            .Update();

            Assert.Equal(0, handler1.Called);
            Assert.Equal(0, handler2.Called);
        }