From 09a0d36b804b911e44e00840aab573710a816fe3 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 23 Jan 2020 15:34:43 +0000 Subject: [PATCH] --- DataFilter/DataFilterFilteringLists.cs | 301 +++++++++++++++---------- 1 file changed, 186 insertions(+), 115 deletions(-) diff --git a/DataFilter/DataFilterFilteringLists.cs b/DataFilter/DataFilterFilteringLists.cs index f8718c4..8efe812 100644 --- a/DataFilter/DataFilterFilteringLists.cs +++ b/DataFilter/DataFilterFilteringLists.cs @@ -269,11 +269,20 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + // foreach (JObject o in v) + // { + // if (IncludedWidgetId == o["id"].Value()) + // InclusiveMatchCount++; + // if (ExcludedWidgetId == o["id"].Value())//whups + // ExclusiveMatchCount++; + // } + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -371,11 +380,20 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + // foreach (JObject o in v) + // { + // if (IncludedWidgetId == o["id"].Value()) + // InclusiveMatchCount++; + // if (ExcludedWidgetId == o["id"].Value())//whups + // ExclusiveMatchCount++; + // } + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -472,11 +490,13 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -574,11 +594,13 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -676,11 +698,13 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -778,11 +802,12 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -881,11 +906,12 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -983,11 +1009,12 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -1085,14 +1112,15 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } - InclusiveMatchCount.Should().BeGreaterOrEqualTo(1); ExclusiveMatchCount.Should().Be(0); @@ -1188,11 +1216,12 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -1292,11 +1321,12 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -1395,11 +1425,13 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -1502,11 +1534,12 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -1611,11 +1644,12 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -1715,11 +1749,13 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -1821,11 +1857,12 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -1924,11 +1961,13 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -2028,11 +2067,13 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -2134,11 +2175,12 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -2240,11 +2282,13 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -2343,11 +2387,13 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -2446,11 +2492,13 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -2568,11 +2616,12 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -2685,11 +2734,12 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -2800,11 +2850,12 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -2916,11 +2967,12 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -3022,11 +3074,13 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -3126,11 +3180,13 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -3231,11 +3287,13 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -3336,11 +3394,13 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -3440,11 +3500,12 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -3546,11 +3607,13 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -3650,11 +3713,13 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -3755,11 +3820,12 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -3859,11 +3925,12 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -3963,11 +4030,12 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -4068,11 +4136,12 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; } @@ -4172,11 +4241,13 @@ same as the server does but in a central location here for all tests to use. List IDInResultList = new List(); int InclusiveMatchCount = 0; int ExclusiveMatchCount = 0; - foreach (JObject o in v) + foreach (JArray ja in v) { - if (IncludedWidgetId == o["id"].Value()) + JObject o = ja[0] as JObject; + + if (IncludedWidgetId == o["v"].Value()) InclusiveMatchCount++; - if (ExcludedWidgetId == o["id"].Value())//whups + if (ExcludedWidgetId == o["v"].Value()) ExclusiveMatchCount++; }