Ejemplo n.º 1
0
 public void SetUp()
 {
     client = new LocalClient(null);
     clientLog = new Log<ChatMessage>();
     stubClientStateTracker = MockRepository.GenerateStub<IClientStateTracker>();
     chatLogQueueMessageHelper = new QueuedMessageHelper<Item, ItemType>();
     playerQueueMessageHelper = new QueuedMessageHelper<Item, ItemType>();
     playerSettingsMessageHelper = new QueuedMessageHelper<Item, ItemType>();
     stubIncomingMessageQueue = MockRepository.GenerateStub<IIncomingMessageQueue>();
     stubIncomingMessageQueue.Stub(x => x.ReadItem(Arg<ItemType>.Is.Equal(ItemType.ChatLog))).Do(chatLogQueueMessageHelper.GetNextQueuedMessage);
     stubIncomingMessageQueue.Stub(x => x.HasAvailable(ItemType.ChatLog)).Do(chatLogQueueMessageHelper.HasMessageAvailable);
     stubIncomingMessageQueue.Stub(x => x.ReadItem(Arg<ItemType>.Is.Equal(ItemType.Player))).Do(playerQueueMessageHelper.GetNextQueuedMessage);
     stubIncomingMessageQueue.Stub(x => x.HasAvailable(ItemType.Player)).Do(playerQueueMessageHelper.HasMessageAvailable);
     stubIncomingMessageQueue.Stub(x => x.ReadItem(Arg<ItemType>.Is.Equal(ItemType.PlayerSettings))).Do(playerSettingsMessageHelper.GetNextQueuedMessage);
     stubIncomingMessageQueue.Stub(x => x.HasAvailable(ItemType.PlayerSettings)).Do(playerSettingsMessageHelper.HasMessageAvailable);
     stubNetworkPlayerProcessor = MockRepository.GenerateStub<INetworkPlayerProcessor>();
     chatLogProcessor = new GameStateProcessor(client, clientLog, stubNetworkPlayerProcessor, stubClientStateTracker, stubIncomingMessageQueue);
 }
Ejemplo n.º 2
0
 public void SetUp()
 {
     stubIncomingMessageQueue = MockRepository.GenerateStub<IIncomingMessageQueue>();
     chatLogQueueMessageHelper = new QueuedMessageHelper<Item, ItemType>();
     playerQueueMessageHelper = new QueuedMessageHelper<Item, ItemType>();
     playerSettingsQueueMessageHelper = new QueuedMessageHelper<Item, ItemType>();
     stubIncomingMessageQueue.Stub(x => x.ReadItem(Arg<ItemType>.Is.Equal(ItemType.ChatLog))).Do(chatLogQueueMessageHelper.GetNextQueuedMessage);
     stubIncomingMessageQueue.Stub(x => x.HasAvailable(ItemType.ChatLog)).Do(chatLogQueueMessageHelper.HasMessageAvailable);
     stubIncomingMessageQueue.Stub(x => x.ReadItem(Arg<ItemType>.Is.Equal(ItemType.PlayerInput))).Do(playerQueueMessageHelper.GetNextQueuedMessage);
     stubIncomingMessageQueue.Stub(x => x.HasAvailable(ItemType.PlayerInput)).Do(playerQueueMessageHelper.HasMessageAvailable);
     stubIncomingMessageQueue.Stub(x => x.ReadItem(Arg<ItemType>.Is.Equal(ItemType.PlayerSettings))).Do(playerSettingsQueueMessageHelper.GetNextQueuedMessage);
     stubIncomingMessageQueue.Stub(x => x.HasAvailable(ItemType.PlayerSettings)).Do(playerSettingsQueueMessageHelper.HasMessageAvailable);
     stubClientStateTracker = MockRepository.GenerateStub<IClientStateTracker>();
     stubNetworkPlayerProcessor = MockRepository.GenerateStub<INetworkPlayerProcessor>();
     serverLog = new Log<ChatMessage>();
     client = new Client(MockRepository.GenerateStub<IPlayer>());
     client.Player.Stub(me => me.PlayerSettings).Return(MockRepository.GenerateStub<IPlayerSettings>());
     clientInputProcessor = new ClientInputProcessor(stubNetworkPlayerProcessor, serverLog, stubClientStateTracker, stubIncomingMessageQueue);
 }