update testEnterSecondStateDoesNotRemoveOverlappingComponents

This commit is contained in:
Igor Kravchenko 2020-09-29 16:37:44 +03:00
parent 81e18ba443
commit 720ba3f565
1 changed files with 11 additions and 0 deletions

View File

@ -274,6 +274,17 @@ class EntityStateMachineTests: XCTestCase {
}
func testEnterSecondStateDoesNotRemoveOverlappingComponents() {
class EventDelegate: NexusEventDelegate {
init() {}
func nexusEvent(_ event: NexusEvent) {
XCTAssertFalse(event is ComponentRemoved, "Component was removed when it shouldn't have been.")
}
func nexusNonFatalError(_ message: String) {}
}
let delgate = EventDelegate()
nexus.delegate = delgate
let state1 = EntityState()
let component1 = MockComponent()
state1.add(MockComponent.self).withInstance(component1)