コード例 #1
0
        public async Task ReturnsExpectedCount()
        {
            // Arrange
            var mockService = new Mock <IMessageDbService>();

            mockService.Setup(service => service.GetAllAsync())
            .ReturnsAsync(TestHelper.GetMessages());

            var controller = new MessagesController(mockService.Object);

            var result = await controller.GetAllAsync();

            Assert.That(result.Value.Count(), Is.EqualTo(2));
        }