public void Start_IsReceived_Return()
        {
            _client.Setup(c => c.IsReceiving).Returns(true);

            _bot.Start();

            _client.VerifyGet(c => c.IsReceiving);
            _client.Verify(c => c.StartReceiving(
                               null,
                               default(CancellationToken)), Times.Never);
        }
Example #2
0
        public ActionResult <StatusOutDto> Start()
        {
            try
            {
                _bot.Start();
            }
            catch
            {
                return(StatusCode(500, new StatusOutDto {
                    Status = "Bot was not started"
                }));
            }

            return(Ok(new StatusOutDto {
                Status = "Bot was started"
            }));
        }