public async void GetAllAsync_ReturnElements()
        {
            var repositoryMock = new Mock <ICrudRepository>();

            repositoryMock.Setup(_ => _.GetAllAsync <Guid, TestEntity>()).ReturnsAsync(_entities);
            var service = new CrudServiceBase <Guid, TestEntity>(repositoryMock.Object);

            var result = await service.GetAllAsync();

            Assert.Equal(result.Count(), _entities.Count());
            repositoryMock.Verify(_ => _.GetAllAsync <Guid, TestEntity>(), Times.Once);
        }
Exemplo n.º 2
0
 public async Task <IEnumerable <T2> > GetAllAsync() => await _service.GetAllAsync();