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)); }
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)); }
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)); }