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(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)); }
public void RegionCanBeLinkedToArea() { var reader1 = new BufferedReader("areas = { test1 test2 test3 } \n"); var region = new ImperatorRegion(reader1); var reader2 = new BufferedReader("{ provinces = { 3 6 2 }} \n"); var area = new ImperatorArea(reader2); Assert.Null(region.Areas["test2"]); // null before linking region.LinkArea("test2", area); Assert.NotNull(region.Areas["test2"]); }