Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }