예제 #1
0
        public void SustainPopulationNeeds_PopulationLessEqualZero_ResourcesDidNotChange()
        {
            Resources from = new Resources(1, 1, 1);

            CivilProduction.SustainPopulationNeeds(0, from);

            Assert.AreEqual(1, from.Hydrogen);
            Assert.AreEqual(1, from.CommonMetals);
            Assert.AreEqual(1, from.RareEarthElements);
        }
예제 #2
0
        public void SustainPopulationNeeds_NotEnoughResources_ResourcesDecreasedToZero()
        {
            const int resourcesAmount = 4999;
            const int population      = 100_000;

            Resources from = new Resources(resourcesAmount, resourcesAmount, resourcesAmount);

            CivilProduction.SustainPopulationNeeds(population, from);

            Assert.AreEqual(0, from.Hydrogen);
            Assert.AreEqual(0, from.CommonMetals);
            Assert.AreEqual(0, from.RareEarthElements);
        }
예제 #3
0
 public void SustainPopulationNeeds_ResourceIsNull_ExceptionThrown()
 {
     Assert.Throws <ArgumentNullException>(() => CivilProduction.SustainPopulationNeeds(1, null));
 }