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