示例#1
0
        public void should_correctly_handle_systems()
        {
            var mockCollectionManager      = Substitute.For <IEntityCollectionManager>();
            var reactToEntitySystemHandler = new SetupSystemHandler(mockCollectionManager);

            var fakeMatchingSystem     = Substitute.For <ISetupSystem>();
            var fakeNonMatchingSystem1 = Substitute.For <IReactToEntitySystem>();
            var fakeNonMatchingSystem2 = Substitute.For <ISystem>();

            Assert.True(reactToEntitySystemHandler.CanHandleSystem(fakeMatchingSystem));
            Assert.False(reactToEntitySystemHandler.CanHandleSystem(fakeNonMatchingSystem1));
            Assert.False(reactToEntitySystemHandler.CanHandleSystem(fakeNonMatchingSystem2));
        }
示例#2
0
        public void should_treat_view_handler_as_setup_system_and_teardown_system()
        {
            var observableGroupManager = Substitute.For <IObservableGroupManager>();
            var setupSystemHandler     = new SetupSystemHandler(observableGroupManager);
            var teardownSystemHandler  = new TeardownSystemHandler(observableGroupManager);

            var viewSystem = Substitute.For <IViewResolverSystem>();

            Assert.True(setupSystemHandler.CanHandleSystem(viewSystem));
            Assert.True(teardownSystemHandler.CanHandleSystem(viewSystem));
        }
示例#3
0
        public void should_treat_view_handler_as_setup_system_and_teardown_system()
        {
            var mockEntityCollectionManager = Substitute.For <IEntityCollectionManager>();
            var setupSystemHandler          = new SetupSystemHandler(mockEntityCollectionManager);
            var teardownSystemHandler       = new TeardownSystemHandler(mockEntityCollectionManager);

            var viewSystem = Substitute.For <IViewResolverSystem>();

            Assert.True(setupSystemHandler.CanHandleSystem(viewSystem));
            Assert.True(teardownSystemHandler.CanHandleSystem(viewSystem));
        }