コード例 #1
0
        public void should_correctly_handle_systems()
        {
            var mockCollectionManager      = Substitute.For <IEntityCollectionManager>();
            var reactToEntitySystemHandler = new ReactToGroupSystemHandler(mockCollectionManager);

            var fakeMatchingSystem     = Substitute.For <IReactToGroupSystem>();
            var fakeNonMatchingSystem1 = Substitute.For <ISetupSystem>();
            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_correctly_handle_systems()
        {
            var observableGroupManager     = Substitute.For <IObservableGroupManager>();
            var threadHandler              = Substitute.For <IThreadHandler>();
            var reactToEntitySystemHandler = new ReactToGroupSystemHandler(observableGroupManager, threadHandler);

            var fakeMatchingSystem     = Substitute.For <IReactToGroupSystem>();
            var fakeMatchingSystem2    = Substitute.For <IReactToGroupExSystem>();
            var fakeNonMatchingSystem1 = Substitute.For <ISetupSystem>();
            var fakeNonMatchingSystem2 = Substitute.For <IGroupSystem>();

            Assert.True(reactToEntitySystemHandler.CanHandleSystem(fakeMatchingSystem));
            Assert.True(reactToEntitySystemHandler.CanHandleSystem(fakeMatchingSystem2));
            Assert.False(reactToEntitySystemHandler.CanHandleSystem(fakeNonMatchingSystem1));
            Assert.False(reactToEntitySystemHandler.CanHandleSystem(fakeNonMatchingSystem2));
        }