public void OnPathRequest(RequestPathMessage message)
 {
     foreach (var selectableObject in m_Objects)
     {
         if (selectableObject.Name == message.Name)
         {
             m_Bus.Send(new PathMessage(selectableObject.Name,
                                        selectableObject.Path.Motion));
         }
     }
 }
        public void MessageRoundTrip()
        {
            const string name = "harry";
            var original = new RequestPathMessage(name);

            var serialiser = new MessageSerialiser();
            serialiser.Register(typeof(RequestPathMessage));

            var text = serialiser.Serialise(original);

            var deserialised = (RequestPathMessage)serialiser.Deserialise(text);

            Assert.NotNull(deserialised);
            Assert.AreEqual(name, deserialised.Name);
        }
Exemplo n.º 3
0
        public void MessageRoundTrip()
        {
            const string name     = "harry";
            var          original = new RequestPathMessage(name);

            var serialiser = new MessageSerialiser();

            serialiser.Register(typeof(RequestPathMessage));

            var text = serialiser.Serialise(original);

            var deserialised = (RequestPathMessage)serialiser.Deserialise(text);

            Assert.NotNull(deserialised);
            Assert.AreEqual(name, deserialised.Name);
        }