public void Stop_WhenCall_CallsMessenger() { var botMediator = GetBotMediator(); var fakeMessenger = new FakeMessengerApi(); botMediator.AddMessenger(fakeMessenger); botMediator.Stop(); Assert.True(fakeMessenger.CheckStop); }
public void Stop_WhenCall_CallsBotMediator() { var messenger = new FakeMessengerApi(); var musicBot = new MusicBot(new MessengerApi[] { messenger }); var botMediator = new FakeBotMediator(); musicBot.SetBotMediator(botMediator); musicBot.Stop(); Assert.True(botMediator.CheckStop); }
public void AddMusicTracksFromFile_WhenCall_CallsMusicHandler() { var messenger = new FakeMessengerApi(); var musicBot = new MusicBot(new MessengerApi[] { messenger }); var musicHandler = new FakeMusicHandler(); const string filePath = "Test"; musicBot.SetMusicHandler(musicHandler); musicBot.AddMusicTracksFromFile(filePath); Assert.AreEqual(musicHandler.FilePath, filePath); }
public void Send_WhenCall_SendsToHandler() { var botMediator = GetBotMediator(); var fakeMessenger = new FakeMessengerApi(); var fakeMessageHandler = new FakeMessageHandlerModule(); var message = GetTestMessage("123123", "Test"); botMediator.SetMessageStateMachine(fakeMessageHandler); botMediator.AddMessenger(fakeMessenger); botMediator.Send(message, fakeMessenger); Assert.AreSame(message, fakeMessageHandler.ReceiveMessage); }