public override Task Execute <T, TResult>(QueryParametersScalar <T, TResult> parameters)
            {
                var executorDb = (Func <Db.OeDataAdapter, DbContext, IList>) new ExpressionScalarClosure <T, TResult>(parameters.Expression).Execute;

                _selectTestDefinitions.Add(new SelectTestDefinition(parameters.RequestUri, executorDb));
                return(Task.CompletedTask);
            }
 public override async Task Execute <T, TResult>(QueryParametersScalar <T, TResult> parameters)
 {
     _queryCount++;
     Task t1 = base.Execute(parameters);
     Task t2 = base.Execute(parameters);
     await Task.WhenAll(t1, t2);
 }
Exemple #3
0
 public async Task Count()
 {
     var parameters = new QueryParametersScalar <Order, int>()
     {
         RequestUri = "Orders/$count",
         Expression = t => t.Count(),
     };
     await Fixture.Execute(parameters);
 }
Exemple #4
0
        public async virtual Task Execute <T, TResult>(QueryParametersScalar <T, TResult> parameters)
        {
            IList fromOe = await ExecuteOe <T, TResult>(parameters.Expression, 0);

            IList fromDb;

            using (var dataContext = new OrderContext(OrderContextOptions.Create(true, null)))
                fromDb = TestHelper.ExecuteDb(DataAdapter.EntitySetAdapters, dataContext, parameters.Expression);

            TestHelper.Compare(fromDb, fromOe, DataAdapter.EntitySetAdapters.EdmModelMetadataProvider, null);
        }
Exemple #5
0
        public async virtual Task Execute <T, TResult>(QueryParametersScalar <T, TResult> parameters)
        {
            IList fromOe = await ExecuteOe <T, TResult>(parameters.Expression, 0);

            IList fromDb;

            using (var dataContext = OrderContext.Create(_databaseName))
                fromDb = TestHelper.ExecuteDb <T, TResult>(dataContext, parameters.Expression);

            TestHelper.Compare(fromDb, fromOe, null);
        }
        public virtual async Task Execute <T, TResult>(QueryParametersScalar <T, TResult> parameters)
        {
            IList fromOe = await ExecuteOe <TResult>(parameters.RequestUri, false, 0).ConfigureAwait(false);

            IList fromDb;

            using (var dataContext = (DbContext)DbDataAdapter.CreateDataContext())
                fromDb = TestHelper.ExecuteDb(DbDataAdapter.EntitySetAdapters, dataContext, parameters.Expression);

            Console.WriteLine(parameters.RequestUri);
            TestHelper.Compare(fromDb, fromOe, null);
        }
Exemple #7
0
        public virtual async Task Execute <T, TResult>(QueryParametersScalar <T, TResult> parameters)
        {
            IList fromOe = await ExecuteOe <TResult>(parameters.RequestUri, false, 0).ConfigureAwait(false);

            ODataUri  odataUri   = ParseUri(parameters.RequestUri);
            IEdmModel dbEdmModel = TestHelper.GetEdmModel(DbEdmModel, odataUri.Path);

            Db.OeDataAdapter dbDataAdapter = DbEdmModel.GetDataAdapter(dbEdmModel.EntityContainer);

            IList fromDb;

            using (var dataContext = (DbContext)dbDataAdapter.CreateDataContext())
                fromDb = TestHelper.ExecuteDb(dbDataAdapter.EntitySetAdapters, dataContext, parameters.Expression);

            Console.WriteLine(parameters.RequestUri);
            TestHelper.Compare(fromDb, fromOe, null);
        }
Exemple #8
0
        public virtual async Task Execute <T, TResult>(QueryParametersScalar <T, TResult> parameters)
        {
            IList fromOe = await ExecuteOe <TResult>(parameters.RequestUri, typeof(T));

            IList fromDb;

            using (var dataContext = (DbContext)DbDataAdapter.CreateDataContext())
                fromDb = TestHelper.ExecuteDb(dataContext, parameters.Expression);

            var settings = new JsonSerializerSettings()
            {
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
                NullValueHandling     = NullValueHandling.Ignore
            };
            String jsonOe = JsonConvert.SerializeObject(fromOe, settings);
            String jsonDb = JsonConvert.SerializeObject(fromDb, settings);

            Console.WriteLine(parameters.RequestUri);
            Xunit.Assert.Equal(jsonDb, jsonOe);
        }
Exemple #9
0
        public virtual Task Execute <T, TResult>(QueryParametersScalar <T, TResult> parameters)
        {
            IList fromOe = ExecuteOe <T, TResult>(parameters.Expression);

            return(Task.CompletedTask);
        }
 public override async Task Execute <T, TResult>(QueryParametersScalar <T, TResult> parameters)
 {
     Task t1 = base.Execute(parameters);
     Task t2 = base.Execute(parameters);
     await Task.WhenAll(t1, t2).ConfigureAwait(false);
 }
 public override async Task Execute <T, TResult>(QueryParametersScalar <T, TResult> parameters)
 {
     Task t1 = base.Execute(parameters);
     //Task t2 = base.Execute(parameters);zzz
     await Task.WhenAll(t1, Task.CompletedTask);
 }