ReadPayload() public method

public ReadPayload ( ISerializationContext context, IValueReader reader ) : void
context ISerializationContext
reader IValueReader
return void
Esempio n. 1
0
        public void SourceResultWithoutSource()
        {
            const string name = "Name";
            var result = Messages.SourceResult.FailedPermissions;
            var msg = new SourceResultMessage (name, result, null);
            Assert.AreEqual (result, msg.SourceResult);
            Assert.AreEqual (name, msg.SourceName);
            msg.WritePayload (serverContext, writer);
            long length = stream.Position;
            stream.Position = 0;

            msg = new SourceResultMessage ();
            msg.ReadPayload (clientContext, reader);
            Assert.AreEqual (length, stream.Position);
            Assert.AreEqual (result, msg.SourceResult);
            Assert.AreEqual (name, msg.SourceName);
        }
Esempio n. 2
0
        public void SourceResult()
        {
            const string name = "Name";
            var result = Messages.SourceResult.Succeeded;
            var source = new AudioSource (name, 1, 2, AudioCodecArgsTests.GetTestArgs());
            var msg = new SourceResultMessage (name, result, source);
            Assert.AreEqual (result, msg.SourceResult);
            Assert.AreEqual (name, msg.SourceName);
            msg.WritePayload (serverContext, writer);
            long length = stream.Position;
            stream.Position = 0;

            msg = new SourceResultMessage();
            msg.ReadPayload (clientContext, reader);
            Assert.AreEqual (length, stream.Position);
            Assert.AreEqual (result, msg.SourceResult);
            Assert.AreEqual (name, msg.SourceName);
        }