Ejemplo n.º 1
0
        public async Task TestGetAllAsync()
        {
            // Arrange
            var mock = new Mock <ITodoItemAsyncRepository>();

            mock.Setup(serv => serv.GetAllAsync()).Returns(async() => { return(DullData.GetAllItemsList()); });
            var service = new TodoItemService(mock.Object);

            // Act
            var value = (await service.GetAllAsync()) as List <TodoItemDTO>;

            // Assert
            Assert.Equal(5, value.Count);
        }