コード例 #1
0
        public void TestFilterAreasNoCodesToIgnore()
        {
            var filteredAreas = new AreaFilter(TestAreas()).RemoveWithAreaCode(new string[] { });
            Assert.AreEqual(3, filteredAreas.Count());

            filteredAreas = new AreaFilter(TestAreas()).RemoveWithAreaCode(null);
            Assert.AreEqual(3, filteredAreas.Count());
        }
コード例 #2
0
        public void TestFilterAreas()
        {
            var codes = new[] { "a", "b" };
            var filteredAreas = new AreaFilter(TestAreas()).RemoveWithAreaCode(codes);

            Assert.AreEqual(1, filteredAreas.Count());
            Assert.AreEqual("c", filteredAreas.First().Code);
        }
コード例 #3
0
        public void TestFilterAreasCaseInsensitive()
        {
            // WRT ignored codes
            var filteredAreas = new AreaFilter(TestAreas()).RemoveWithAreaCode(new[] { "A", "B" });

            Assert.AreEqual(1, filteredAreas.Count());
            Assert.AreEqual("c", filteredAreas.First().Code);

            // WRT coredataset area codes
            var areas = TestAreas();
            foreach (var area in areas)
            {
                area.Code = area.Code.ToUpper();
            }
            filteredAreas = new AreaFilter(areas).RemoveWithAreaCode(new[] { "a", "b" });

            Assert.AreEqual(1, filteredAreas.Count());
            Assert.AreEqual("C", filteredAreas.First().Code);
        }