Exemplo n.º 1
0
        public void LinqSelect_SelectAll_Async()
        {
            var table = _table;
            var count = table.Count().Execute();

            Assert.AreEqual(_entityList.Count, count);

            List <AllDataTypesEntity> allEntities = table.Select(m => m).ExecuteAsync().Result.ToList();

            Assert.AreEqual(_entityList.Count, allEntities.Count);
            foreach (var entity in allEntities)
            {
                AllDataTypesEntityUtil.AssertListContains(_entityList, entity);
            }
        }
Exemplo n.º 2
0
        public void LinqSelect_DateTimeOffsetType_Sync()
        {
            List <AllDataTypesEntity> actualEntities = _table.Select(e => new AllDataTypesEntity {
                DateTimeOffsetType = e.DateTimeOffsetType
            }).Execute().ToList();

            Assert.AreEqual(_entityList.Count, actualEntities.Count);
            foreach (var entity in _entityList)
            {
                AllDataTypesEntity expectedEntity = new AllDataTypesEntity
                {
                    DateTimeOffsetType = entity.DateTimeOffsetType
                };
                AllDataTypesEntityUtil.AssertListContains(actualEntities, expectedEntity);
            }
        }
Exemplo n.º 3
0
        public void LinqSelect_SelectAll_Sync(bool async)
        {
            var table = _table;

            AllDataTypesEntity.PrimeRangeSelect(TestCluster, _entityList);

            List <AllDataTypesEntity> allEntities =
                async
                    ? table.Select(m => m).ExecuteAsync().GetAwaiter().GetResult().ToList()
                    : table.Select(m => m).Execute().ToList();

            Assert.AreEqual(_entityList.Count, allEntities.Count);
            foreach (var entity in allEntities)
            {
                AllDataTypesEntityUtil.AssertListContains(_entityList, entity);
            }
        }
Exemplo n.º 4
0
        public void LinqSelect_DateTimeOffsetType_Sync()
        {
            TestCluster.PrimeFluent(
                b => b.WhenQuery("SELECT \"date_time_offset_type\" FROM \"allDataTypes\" ALLOW FILTERING")
                .ThenRowsSuccess(
                    new[] { "date_time_offset_type" },
                    rows => rows.WithRows(_entityList.Select(e => new object[] { e.DateTimeOffsetType }).ToArray())));
            List <AllDataTypesEntity> actualEntities = _table.Select(e => new AllDataTypesEntity {
                DateTimeOffsetType = e.DateTimeOffsetType
            }).Execute().ToList();

            Assert.AreEqual(_entityList.Count, actualEntities.Count);
            foreach (var entity in _entityList)
            {
                AllDataTypesEntity expectedEntity = new AllDataTypesEntity
                {
                    DateTimeOffsetType = entity.DateTimeOffsetType
                };
                AllDataTypesEntityUtil.AssertListContains(actualEntities, expectedEntity);
            }
        }