public virtual PlayerProfileMessage PlayerProfile(PlayerProfile profile) { PlayerProfileMessage msg = new PlayerProfileMessage(); msg.Profile = profile; return(msg); }
public void RegisterOnPlayerProfile(ListGameRecordsFor callback) { server.RegisterHandler( PlayerProfileMessage.Type, delegate(NetworkMessage netMsg) { PlayerProfileMessage msg = netMsg.ReadMessage <PlayerProfileMessage>(); netMsg.conn.Send( GameRecordListMessage.Type, factory.GameRecordList(callback(msg.Profile)) ); } ); }
public void TestItSendsAPlayerProfileCorrectly() { PlayerProfileMessage msg = Substitute.For <PlayerProfileMessage>(); PlayerProfile profile = new PlayerProfile("jayden", Arg.Any <Color>()); factoryMock.PlayerProfile(profile).Returns(msg); subject.SendPlayerProfile(profile); factoryMock.Received().PlayerProfile(profile); clientMock.Received().Send( PlayerProfileMessage.Type, msg ); }