public void CanAddGameObjectsToStage() { var gameStage = new MockGameStage(); var gameObject = new GameObject(); gameStage.AddGameObject(gameObject); Assert.IsTrue(gameStage.GameObjects.Contains(gameObject)); var gameObject2 = new GameObject(); gameStage.AddGameObject(gameObject2); Assert.IsTrue(gameStage.GameObjects.Contains(gameObject2)); }
public void GameStageIsAssignedToTheGameObjectWhenAddedToTheStage() { var gameStage = new MockGameStage(); var gameObject = new GameObject(); gameStage.AddGameObject(gameObject); Assert.AreSame(gameStage, gameObject.GameStage); }
public void CanRemoveGameObjectsFromStage() { var gameStage = new MockGameStage(); var gameObject = new GameObject(); gameStage.AddGameObject(gameObject); gameStage.RemoveGameObject(gameObject); Assert.IsFalse(gameStage.GameObjects.Contains(gameObject)); }
public void DestroyRemovesGameObjectFromStage() { var gameStage = new MockGameStage(); var gameObject = new GameObject(); gameStage.AddGameObject(gameObject); gameObject.Destroy(); Assert.IsFalse(gameStage.GameObjects.Contains(gameObject)); }
public void CanRemoveObjectFromStageUsingDestroy() { var gameStage = new MockGameStage(); var gameObject = new GameObject(); var behavior = new MockBehavior(); gameObject.AddComponent(behavior); gameStage.AddGameObject(gameObject); behavior.MockDestroy(); Assert.IsFalse(gameStage.GameObjects.Contains(gameObject)); }
public void DestroyRemovesGameObjectFromParent() { var gameStage = new MockGameStage(); var parent = new GameObject(); gameStage.AddGameObject(parent); var child = new GameObject(); parent.AddChild(child); child.Destroy(); Assert.IsFalse(parent.Children.Contains(child)); Assert.IsFalse(gameStage.GameObjects.Contains(child)); }
public void ChildrenGameObjectsHaveAccessToGameStage() { var parent = new GameObject(); var child = new GameObject(); parent.AddChild(child); var gameStage = new MockGameStage(); gameStage.AddGameObject(parent); Assert.AreSame(gameStage, child.GameStage); }
public void CanAddGameObjectDirectlyToGameStageThroughAddGameObject() { var gameStage = new MockGameStage(); var gameObject = new GameObject(); var behavior = new MockBehavior(); gameObject.AddComponent(behavior); gameStage.AddGameObject(gameObject); var gameObjectToAdd = new GameObject(); behavior.AddGameObject(gameObjectToAdd); Assert.IsTrue(gameStage.GameObjects.Contains(gameObjectToAdd)); }