public async Task GetCompanyRatesShoiuldReturnCorrectTotalRatesForCurrentCompany() { var companyId = 1; var options = new DbContextOptionsBuilder <ApplicationDbContext>() .UseInMemoryDatabase(Guid.NewGuid().ToString()); var mockRepository = new EfDeletableEntityRepository <Rate>(new ApplicationDbContext(options.Options)); var service = new RatingsService(mockRepository); await service.RateAsync(companyId, "UserId1", 3); await service.RateAsync(companyId, "UserId2", 5); await service.RateAsync(companyId, "UserId3", 4); var companyRatesCount = service.GetCompanyRates(companyId); Assert.Equal(3, companyRatesCount); }