public void DisposeTest()
        {
            var dt   = GetDataTable(2);
            var test = new FilterDataTable(dt.Item1);

            test.Dispose();
        }
        public async Task ColumnsWithoutErrorsAsync()
        {
            var dt   = GetDataTable(2000);
            var test = new FilterDataTable(dt.Item1);
            await test.FilterAsync(0, FilterType.ErrorsAndWarning, UnitTestInitializeCsv.Token);

            // not a good test, but its known how many columns will have errors
            Assert.AreEqual(dt.Item2, test.ColumnsWithoutErrors.Count);
        }
        public async Task FilterDataTableTest()
        {
            var dt   = GetDataTable(2000);
            var test = new FilterDataTable(dt.Item1);
            await test.FilterAsync(0, FilterType.ErrorsAndWarning, UnitTestInitializeCsv.Token);

            Assert.IsTrue(test.FilterTable.Rows.Count > 0);

            Assert.AreEqual(4, test.ColumnsWithErrors.Count);
        }
        public void CancelTest()
        {
            var dt = GetDataTable(2000);

            using (var test = new FilterDataTable(dt.Item1))
            {
                test.Cancel();
                // No effect but no error either
                _ = test.FilterAsync(0, FilterType.ShowErrors, UnitTestInitializeCsv.Token);
                // Assert.IsTrue(test.Filtering);
                test.Cancel();
                // Assert.IsFalse(test.Filtering);
            }
        }
        public void UniqueFieldName()
        {
            var dt = GetDataTable(10);

            using (var test = new FilterDataTable(dt.Item1))
            {
                test.UniqueFieldName = new[] { "ColID" };
                var task = test.FilterAsync(0, FilterType.ErrorsAndWarning, UnitTestInitializeCsv.Token).ConfigureAwait(false);
                while (test.Filtering)
                {
                    test.WaitCompeteFilter(0.1);
                }

                Assert.IsFalse(test.Filtering);
                var result1 = test.ColumnsWithoutErrors;
                Assert.IsFalse(result1.Contains("ColID"));
            }
        }