Exemplo n.º 1
0
        public void Can_ExistsTask()
        {
            var countTasks = new List <Task <bool> >();

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

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

            foreach (var task in countTasks)
            {
                Assert.IsTrue(task.Result);
                if (IsDebugEnabled)
                {
                    log.Debug("Exists = " + task.Result);
                }
            }
        }