Ejemplo n.º 1
0
        public void GetNeighboursTest()
        {
            var country = new CountryDummyCreator().Create();

            var startRegion = regionCreator.Create(country);

            var region1 = regionCreator.Create(country);
            var region2 = regionCreator.Create(country);

            var passageCreator = new PassageDummyCreator();

            passageCreator.Create(startRegion, region1);
            passageCreator.Create(region1, startRegion);

            List <int> neighboursIDs = new List <int> {
                region1.ID, region2.ID
            };

            var neighbours = startRegion.GetNeighbours();

            foreach (var neighbour in neighbours)
            {
                Assert.IsTrue(neighboursIDs.Contains(neighbour.Region.ID));
            }
        }
Ejemplo n.º 2
0
        public void ProcessDayChangeNoGoldForUpkeepRegion()
        {
            var embargo = new EmbargoDummyCreator().Create();

            var regionCreator = new RegionDummyCreator();

            regionCreator.Create(embargo.CreatorCountry);
            regionCreator.Create(embargo.EmbargoedCountry);

            embargoRepository.Setup(x => x.GetAllActiveEmbargoes()).Returns(new List <Embargo> {
                embargo
            });

            embargoService.ProcessDayChange(123);
            Assert.IsFalse(embargo.Active); // not enough money
        }