ReadPayload() public method

public ReadPayload ( ISerializationContext context, IValueReader reader ) : void
context ISerializationContext
reader IValueReader
return void
Exemplo n.º 1
0
        public void UserLoggedIn()
        {
            var msg = new UserJoinedMessage (UserInfoTests.GetTestUser());
            msg.WritePayload (serverContext, writer);
            long length = stream.Position;
            stream.Position = 0;

            msg = new UserJoinedMessage();
            msg.ReadPayload (clientContext, reader);
            Assert.AreEqual (length, stream.Position);
            UserInfoTests.AssertUserInfosMatch (UserInfoTests.GetTestUser(), msg.UserInfo);
        }
Exemplo n.º 2
0
        public void UserJoined()
        {
            var user = new UserInfo ("Nickname", "Username", 1, 2, true);
            var msg = new UserJoinedMessage (user);
            Assert.AreEqual (user.UserId, msg.UserInfo.UserId);
            Assert.AreEqual (user.CurrentChannelId, msg.UserInfo.CurrentChannelId);
            Assert.AreEqual (user.Nickname, msg.UserInfo.Nickname);
            Assert.AreEqual (user.Username, msg.UserInfo.Username);
            Assert.AreEqual (user.IsMuted, msg.UserInfo.IsMuted);
            msg.WritePayload (serverContext, writer);
            long length = stream.Position;
            stream.Position = 0;

            msg = new UserJoinedMessage();
            msg.ReadPayload (clientContext, reader);
            Assert.AreEqual (length, stream.Position);
            Assert.AreEqual (user.UserId, msg.UserInfo.UserId);
            Assert.AreEqual (user.CurrentChannelId, msg.UserInfo.CurrentChannelId);
            Assert.AreEqual (user.Nickname, msg.UserInfo.Nickname);
            Assert.AreEqual (user.Username, msg.UserInfo.Username);
            Assert.AreEqual (user.IsMuted, msg.UserInfo.IsMuted);
        }