Пример #1
0
 public void GetPropertyFromGameObject()
 {
     GameObject newGameObject = new GameObject("new game object");
     Property newProperty = new Property(PropertyType.String, "new property", "a new value");
     newGameObject.AddProperty(newProperty);
     Assert.IsTrue(newProperty.Value == newGameObject.GetProperty(newProperty.Name).Value);
 }
Пример #2
0
 public void ReceiveMessage_AddProperty()
 {
     GameObject newGameObject = new GameObject("new game object");
     Message newMessage = new Message(newGameObject.Name,MessageAction.Add, "new property", "a value", PropType.String);
     Response response = newGameObject.ReceiveMessage(newMessage);
     Assert.IsTrue(response.Status);
     Assert.IsTrue(newGameObject.DoesPropertyExist("new property"));
     Assert.IsTrue("a value" == newGameObject.GetProperty("new property").Value);
 }
Пример #3
0
 public void SetPropertyOnGameObject()
 {
     GameObject newGameObject = new GameObject("new game object");
     Property newProperty = new Property(PropertyType.String, "new property", "a new value");
     newGameObject.AddProperty(newProperty);
     string newPropValue = "even newer value ";
     Assert.IsTrue(newGameObject.SetProperty(newProperty.Name, newPropValue, newProperty.Type ));
     Assert.IsTrue(newGameObject.GetProperty(newProperty.Name).Value == newPropValue);
 }
Пример #4
0
        public void ReceiveMessage_SetProperty()
        {
            GameObject newGameObject = new GameObject("new game object");
            Property newProperty = new Property(PropertyType.String, "new property", "a value");
            newGameObject.AddProperty(newProperty);

            Message setMessage = new Message(newGameObject.Name, MessageAction.Set, newProperty.Name,"a new value", PropType.String);
            Response response = newGameObject.ReceiveMessage(setMessage);
            Assert.IsTrue(response.Status);
            Assert.IsTrue(response.Property == newProperty.Name);
            Assert.IsTrue(response.Value != newProperty.Value);
            Assert.IsTrue(response.Value == newGameObject.GetProperty(newProperty.Name).Value);
        }