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); }
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); }
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) ); }
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) ); }
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) ); }
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)); }
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"]); }
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)); }