Пример #1
0
        public void LinkedRegionWillFailForProvinceMismatch()
        {
            var reader1 = new BufferedReader(string.Empty);
            var region  = new ImperatorRegion(reader1);

            var reader2 = new BufferedReader("{ provinces  = { 3 6 2 }} \n");
            var area    = new ImperatorArea(reader2);

            region.LinkArea("test2", area);

            Assert.False(region.ContainsProvince(7));
        }
Пример #2
0
        public void LinkedRegionCanLocateProvince()
        {
            var reader1 = new BufferedReader(string.Empty);
            var region  = new ImperatorRegion(reader1);

            var reader2 = new BufferedReader("{ provinces  = { 3 6 2 }} \n");
            var area    = new ImperatorArea(reader2);

            region.LinkArea("test2", area);

            Assert.True(region.ContainsProvince(6));
        }
        public void LinkedRegionWillFailForProvinceMismatch()
        {
            var reader1 = new BufferedReader("{ areas={area1} }");
            var region  = new ImperatorRegion("region1", reader1);

            var reader2 = new BufferedReader("{ provinces  = { 3 6 2 }}");
            var area    = new ImperatorArea("area1", reader2);
            var areas   = new IdObjectCollection <string, ImperatorArea> {
                area
            };

            region.LinkAreas(areas);

            Assert.False(region.ContainsProvince(7));
        }
        public void LinkedRegionCanLocateProvince()
        {
            var reader1 = new BufferedReader("{ areas={area1} }");
            var region  = new ImperatorRegion("region1", reader1);

            var reader2 = new BufferedReader("{ provinces = { 3 6 2 }}");
            var area    = new ImperatorArea("area1", reader2);
            var areas   = new IdObjectCollection <string, ImperatorArea> {
                area
            };

            region.LinkAreas(areas);

            Assert.True(region.ContainsProvince(6));
        }