예제 #1
0
        public void Can_ExecuteNonQueryTask()
        {
            var executeScalarTasks = new List <Task <int> >();

            foreach (var section in Sections)
            {
                var query = NorthwindAdoRepository.QueryProvider.GetQuery(section, QueryKey);
                Assert.IsNotEmpty(query);

                var countQuery = AdoTool.GetCountingSqlString(query);

                var task = NorthwindAdoRepository.ExecuteNonQueryAsync(countQuery);
                executeScalarTasks.Add(task);
            }

            Task.WaitAll(executeScalarTasks.ToArray());
            executeScalarTasks.All(t => t.IsCompleted).Should().Be.True();
        }