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

            Assert.True(_bot.Ping());

            _client.VerifyGet(c => c.IsReceiving);

            _client.Verify(c => c.StartReceiving(
                               null,
                               default(CancellationToken)), Times.Never);
        }
示例#2
0
        public ActionResult <StatusOutDto> Ping()
        {
            var healthy = _bot.Ping();

            return(healthy
                ? Ok(new StatusOutDto {
                Status = "Pong, Bot is receiving"
            })
                : StatusCode(500, new StatusOutDto {
                Status = "Bot is not receiving"
            }));
        }