public async Task CreateAndGet_ListWithFunctionTest() { var newCars = TestCarsCatalog.SaveCarsInDB(carService); var getResult = await brandService.QueryWithProjectionAsync <BrandInfo>(new BaseBrandQuery()); getResult.Results.Should().OnlyContain(x => x.FirstRelease > 0 && x.NbCars > 0); }
public CarService_Tests() { carService = Resolve <ICarService>(); var t = Resolve <CarCatalogContext>(); t.Database.EnsureCreated(); carList = TestCarsCatalog.SaveCarsInDB(carService); }
public async Task EF5IncludeWithFunction_Test() { TestCarsCatalog.SaveCarsInDB(carService); var getResult = await brandService.QueryAsync( new BaseBrandQuery() { Includes = new List <System.Linq.Expressions.Expression <Func <Brand, object> > >() { x => x.Cars.Where(x => x.Name.StartsWith("A3")) }, } , includeCount : true); getResult.Results.Where(x => x.Cars.Count >= 1).Should().HaveCount(1); getResult.Results.First(x => x.Cars.Count >= 1).Cars.FirstOrDefault().Name.Should().Be("A3"); }