public async Task GetAllAvaibleLoadsAsync_WithoutData_ShouldReturnEmptyList() { var context = SteuDbContextInMemoryFactory.InitializeContext(); LoadsService service = IntializeLoadService(context); var actualResult = await service.GetAllAvaibleLoadsAsync(1, 10); Assert.Empty(actualResult); }
public async Task GetAllAvaibleLoadsAsync_WithCorrectData_ShouldReturnListOfLoads() { var context = SteuDbContextInMemoryFactory.InitializeContext(); LoadsService service = IntializeLoadService(context); var repository = new EfDeletableEntityRepository <Order>(context); await repository.AddAsync(new Order() { Id = "asdasd", Load = new Load(), ExpireTime = DateTime.UtcNow.AddDays(7), IsDeleted = false, }); await context.SaveChangesAsync(); var actualResult = await service.GetAllAvaibleLoadsAsync(1, 10); Assert.Single(actualResult); }