示例#1
0
        public async void CheckStats()
        {
            string        expected  = "200";
            GetStatsQuery getquery  = new GetStatsQuery();
            StatsView     statitics = new StatsView(1, 1);

            _mediator
            .Setup(m => m.Send(It.IsAny <GetStatsQuery>(), It.IsAny <CancellationToken>()))
            .ReturnsAsync(statitics).Verifiable();

            ActionResult <StatsView> actionResult = await _sut.GetStats();

            var result = actionResult.Result as OkObjectResult;

            Assert.Equal(expected, result.StatusCode.ToString());
            _mediator.VerifyAll();
        }