public async Task GetAsync_OneGenericVersion_Success_Should_ReturnEntityInDatabase() { var aggregateRoot = new TestAggregateRoot("testing"); _Context.Add(aggregateRoot); await _Context.SaveChangesAsync(); _Context.ChangeTracker.Clear(); IRepositoryAsync <TestAggregateRoot> repository = new TestAggregateRootRepository1(_Context); var entity = await repository.GetAsync(new object[] { aggregateRoot.Id }); entity.Should().NotBeNull(); }
public async Task GetAsync_OneGenericVersion_Success_Should_ReturnEntitiesInDatabase() { var aggregateRoot = new TestAggregateRoot("testing"); var expCount = 1; _Context.Add(aggregateRoot); await _Context.SaveChangesAsync(); _Context.ChangeTracker.Clear(); IRepositoryAsync <TestAggregateRoot> repository = new TestAggregateRootRepository1(_Context); var list = await repository.GetAsync(); list.Should().HaveCount(expCount); }