public async Task Handle_WithCorrectActionResponse_ShouldCallSendTextMessageAsyncWithCorrectParameters() { var actionResponse = MakeActionResponse(); var botMock = new Mock <IBot>(); botMock.Setup(b => b.SendTextMessageAsync(It.IsAny <long>(), It.IsAny <string>())); var msg = _spawnMessageService.Generate(actionResponse); await _controller.HandleAsync(botMock.Object, actionResponse); botMock.Verify(b => b.SendTextMessageAsync( actionResponse.Action.Message.Chat.Id, msg ), Times.Once); }
public void Generate_WithNoPokemonSpawn_ShouldThrow() { var actionResponse = MakeActionResponse(null); Assert.Throws <ArgumentException>(() => _service.Generate(actionResponse)); }