public void UnObserverGameObject()
 {
     GameObserver observer = new GameObserver();
     GameObject newGameObject = new GameObject("new game object");
     observer.ObserveGameObject(newGameObject);
     Assert.IsTrue(observer.UnobserveGameObject(newGameObject.Name));
 }
        public void SendMessageToMissingObject()
        {
            GameObserver observer = new GameObserver();
            GameObject newGameObject = new GameObject("new game object");

            Message message = new Message(newGameObject.Name, MessageAction.Add, "new property", "a value", PropType.String);
            Response response = observer.SendMessage(message);
            Assert.IsFalse(response.Status);
            Assert.IsTrue(response.Value == "GameObject is not being observed");
            Assert.IsTrue(response.PropType == PropType.Error);
        }
 public void SendMessageToActiveObject()
 {
     GameObserver observer = new GameObserver();
     GameObject newGameObject = new GameObject("new game object");
     observer.ObserveGameObject(newGameObject);
     Message message = new Message(newGameObject.Name, MessageAction.Add, "new property", "a value", PropType.String);
     Response response = observer.SendMessage(message);
     Assert.IsTrue(response.Status);
     Assert.IsTrue(response.Property == "new property");
     Assert.IsTrue(response.Value == "a value");
     Assert.IsTrue(response.PropType == PropType.String);
 }
 public NewGameObject(GameObserver observer)
 {
     InitializeComponent();
     Observer = observer;
 }
 public void ObserveGameObject()
 {
     GameObserver observer = new GameObserver();
     GameObject newGameObject = new GameObject("new game object");
     Assert.IsTrue(observer.ObserveGameObject(newGameObject));
 }