public void TestBaseFunctionality()
        {
            Fraction             testFraction         = new Fraction("test");
            Point                testPosition         = new Point(1, 1);
            TerritoryChangeEvent territoryChangeEvent = new TerritoryChangeEvent(testPosition, testFraction);

            JEventBus.GetDefault().Post(territoryChangeEvent);

            FindTerritoryOwnerEvent checkTestPositionOwner = new FindTerritoryOwnerEvent(testPosition);

            JEventBus.GetDefault().Post(checkTestPositionOwner);
            Assert.IsTrue(checkTestPositionOwner.Success);
            Assert.IsNotNull(checkTestPositionOwner.Owner);
            Assert.IsTrue(testFraction == checkTestPositionOwner.Owner);

            Assert.AreEqual(1, TerritoryApi.GetTerritoryCellsAmount(testFraction));

            foreach (var utp in new SquareRadiusForeach(testPosition, 1, 8, 8, true).LikePointList())
            {
                FindTerritoryOwnerEvent findTerritoryOwnerEvent = new FindTerritoryOwnerEvent(utp);
                JEventBus.GetDefault().Post(findTerritoryOwnerEvent);
                Assert.IsTrue(findTerritoryOwnerEvent.Success);
                Assert.IsNull(findTerritoryOwnerEvent.Owner);
            }
        }
        public void TestEncirclementBug2()
        {
            Fraction testFraction = new Fraction("test");
            Point    testPosition = new Point(2, 2);

            foreach (var utp in new SquareRadiusForeach(testPosition, 1, 8, 8).LikePointList())
            {
                TerritoryApi.ChangeTerritoryOwner(utp, testFraction);
            }

            FindTerritoryOwnerEvent checkTestPositionOwner = new FindTerritoryOwnerEvent(testPosition);

            JEventBus.GetDefault().Post(checkTestPositionOwner);
            Assert.IsTrue(checkTestPositionOwner.Success);
            Assert.IsNotNull(checkTestPositionOwner.Owner);
            Assert.AreEqual(testFraction, checkTestPositionOwner.Owner);

            Assert.AreEqual(9, TerritoryApi.GetTerritoryCellsAmount(testFraction));
        }
        public void TestEncirclementBug1()
        {
            Fraction        testFraction    = new Fraction("test");
            Point           testPosition    = new Point(0, 0);
            PositionBuilder positionBuilder = new PositionBuilder(testPosition);

            TerritoryApi.ChangeTerritoryOwner(testPosition, testFraction);
            TerritoryApi.ChangeTerritoryOwner(positionBuilder.Top(), testFraction);
            TerritoryApi.ChangeTerritoryOwner(positionBuilder.Right(), testFraction);
            TerritoryApi.ChangeTerritoryOwner(positionBuilder.TopRight(), testFraction);

            FindTerritoryOwnerEvent checkTestPositionOwner = new FindTerritoryOwnerEvent(testPosition);

            JEventBus.GetDefault().Post(checkTestPositionOwner);
            Assert.IsTrue(checkTestPositionOwner.Success);
            Assert.IsNotNull(checkTestPositionOwner.Owner);
            Assert.AreEqual(testFraction, checkTestPositionOwner.Owner);

            Assert.AreEqual(4, TerritoryApi.GetTerritoryCellsAmount(testFraction));
        }