public async Task TestGetLiteDb() { using var db = SetupLiteDb(); var repoDbDataLayer = new LiteDbDataLayer(db); var asyncEnumerable = await repoDbDataLayer .GetAsync((Expression <Func <OrderRecord, bool> >) _getOrderByIdPredicate); var returnValue = await asyncEnumerable.ToListAsync(); Assert.AreEqual(1, returnValue.Count); }
public async Task TestGetDbLiteViaGraphQL() { using var db = SetupLiteDb(); var schema = SchemaBuilder.FromObject <OrdersDbContext>(); var expressionFromGraphQLProvider = new ExpressionFromGraphQLProvider(schema); var expression = expressionFromGraphQLProvider.GetExpression($@"orderRecord.where(id = ""{_id}"")"); await CreateOrdersDb(); var repoDbDataLayer = new LiteDbDataLayer(db); var asyncEnumerable = await repoDbDataLayer .GetAsync((Expression <Func <OrderRecord, bool> >) expression); var returnValue = await asyncEnumerable.ToListAsync(); Assert.AreEqual(1, returnValue.Count); }