예제 #1
0
        public void MultipleDuchiesCanBeLoaded()
        {
            var reader = new BufferedReader("duchies = { d_ivrea d_athens d_oppo }");
            var region = CK3Region.Parse(reader);

            Assert.Equal(3, region.Duchies.Count);
        }
예제 #2
0
        public void BlankRegionLoadsWithNoRegionsAndNoDuchies()
        {
            var reader = new BufferedReader(string.Empty);
            var region = CK3Region.Parse("region1", reader);

            Assert.Empty(region.Regions);
            Assert.Empty(region.Duchies);
        }
예제 #3
0
        public void MultipleRegionsCanBeLoaded()
        {
            var reader = new BufferedReader(
                "regions = { sicily_region island_region new_region }");
            var region = CK3Region.Parse(reader);

            Assert.Equal(3, region.Regions.Count);
        }
예제 #4
0
        public void RegionCanBeLoaded()
        {
            var reader = new BufferedReader("regions = { sicily_region }");
            var region = CK3Region.Parse(reader);

            Assert.Collection(region.Regions,
                              item => Assert.Equal("sicily_region", item.Key)
                              );
        }
예제 #5
0
        public void AreaCanBeLoaded()
        {
            var reader = new BufferedReader("duchies = { d_ivrea } \n");
            var region = CK3Region.Parse(reader);

            Assert.Collection(region.Duchies,
                              item => Assert.Equal("d_ivrea", item.Key)
                              );
        }
예제 #6
0
        public void RegionCanBeLoaded()
        {
            var reader = new BufferedReader("regions = { sicily_region }");
            var region = CK3Region.Parse("region1", reader);

            Assert.Empty(region.Duchies);             // not linked yet

            region.LinkRegion(new CK3Region("sicily_region"));
            Assert.Collection(region.Regions,
                              item => Assert.Equal("sicily_region", item.Key)
                              );
        }
예제 #7
0
        public void MultipleRegionsCanBeLoaded()
        {
            var reader = new BufferedReader(
                "regions = { sicily_region island_region new_region }");
            var region = CK3Region.Parse("region1", reader);

            Assert.Empty(region.Regions);             // not linked yet

            region.LinkRegion(new CK3Region("sicily_region"));
            region.LinkRegion(new CK3Region("island_region"));
            region.LinkRegion(new CK3Region("new_region"));
            Assert.Equal(3, region.Regions.Count);
        }
예제 #8
0
        public void MultipleDuchiesCanBeLoaded()
        {
            var reader = new BufferedReader("duchies = { d_ivrea d_athens d_oppo }");
            var region = CK3Region.Parse("region1", reader);

            Assert.Empty(region.Duchies);             // not linked yet

            var titles = new Title.LandedTitles();

            region.LinkDuchy(titles.Add("d_ivrea"));
            region.LinkDuchy(titles.Add("d_athens"));
            region.LinkDuchy(titles.Add("d_oppo"));
            Assert.Equal(3, region.Duchies.Count);
        }
예제 #9
0
        public void DuchyCanBeLoaded()
        {
            var reader = new BufferedReader("duchies = { d_duchy }");
            var region = CK3Region.Parse("region1", reader);

            Assert.Empty(region.Duchies);             // not linked yet

            var titles = new Title.LandedTitles();

            region.LinkDuchy(titles.Add("d_duchy"));
            Assert.Collection(region.Duchies,
                              item => Assert.Equal("d_duchy", item.Key)
                              );
        }
예제 #10
0
        public void LinkedRegionWillFailForProvinceMismatch()
        {
            var reader = new BufferedReader("duchies = { d_ivrea d_athens d_oppo }");
            var region = CK3Region.Parse(reader);

            var reader2 = new BufferedReader(
                "{ c_athens = { b_athens = { province = 79 } b_newbarony = { province = 56 } } }"
                );
            var duchy2 = new Title("d_athens");

            duchy2.LoadTitles(reader2);

            region.LinkDuchy(duchy2);

            Assert.False(region.ContainsProvince(7));
        }
예제 #11
0
        public void RegionCanBeLinkedToDuchy()
        {
            var reader = new BufferedReader("duchies = { d_ivrea d_athens d_oppo }");
            var region = CK3Region.Parse(reader);

            var reader2 = new BufferedReader(
                "{ c_athens = { b_athens = { province = 79 } b_newbarony = { province = 56 } } }"
                );
            var duchy2 = new Title("d_athens");

            duchy2.LoadTitles(reader2);

            Assert.Null(region.Duchies["d_athens"]);             // nullptr before linking
            region.LinkDuchy(duchy2);
            Assert.NotNull(region.Duchies["d_athens"]);
        }
예제 #12
0
        public void RegionCanBeLinkedToDuchy()
        {
            var reader = new BufferedReader("duchies = { d_ivrea d_athens d_oppo }");
            var region = CK3Region.Parse("region1", reader);

            var titles  = new Title.LandedTitles();
            var reader2 = new BufferedReader(
                "{ c_athens = { b_athens = { province = 79 } b_newbarony = { province = 56 } } }"
                );
            var duchy2 = titles.Add("d_athens");

            duchy2.LoadTitles(reader2);

            Assert.False(region.Duchies.ContainsKey("d_athens"));             // not linked yet
            region.LinkDuchy(duchy2);
            Assert.NotNull(region.Duchies["d_athens"]);
        }
예제 #13
0
        public void LinkedRegionCanLocateProvince()
        {
            var reader = new BufferedReader("duchies = { d_ivrea d_athens d_oppo }");
            var region = CK3Region.Parse(reader);

            var reader2 = new BufferedReader(
                "= { c_athens = { b_athens = { province = 79 } b_newbarony = { province = 56 } } }"
                );
            var duchy2 = new Title("d_athens");

            duchy2.LoadTitles(reader2);

            region.LinkDuchy(duchy2);

            Assert.True(region.ContainsProvince(79));
            Assert.True(region.ContainsProvince(56));
        }