Example #1
0
        public void TemperatureAndHumidityValidTest()
        {
            Biome testBiome = new Biome("test");
            var   hot       = Hex.TemperatureLevel.Hot;
            var   cold      = Hex.TemperatureLevel.Cold;
            var   arid      = Hex.HumidityLevel.Arid;
            var   humid     = Hex.HumidityLevel.Humid;

            Assert.IsFalse(testBiome.TemperatureAndHumidityValid(hot, arid));
            Assert.IsFalse(testBiome.TemperatureAndHumidityValid(cold, humid));

            testBiome.AddHumidity(arid);
            Assert.IsFalse(testBiome.TemperatureAndHumidityValid(hot, arid));
            Assert.IsFalse(testBiome.TemperatureAndHumidityValid(cold, humid));
            Assert.IsFalse(testBiome.TemperatureAndHumidityValid(cold, arid));
            Assert.IsFalse(testBiome.TemperatureAndHumidityValid(hot, humid));

            testBiome.AddTemperature(hot);
            Assert.IsTrue(testBiome.TemperatureAndHumidityValid(hot, arid));
            Assert.IsFalse(testBiome.TemperatureAndHumidityValid(cold, humid));
            Assert.IsFalse(testBiome.TemperatureAndHumidityValid(cold, arid));
            Assert.IsFalse(testBiome.TemperatureAndHumidityValid(hot, humid));

            testBiome.AddHumidity(humid);
            Assert.IsTrue(testBiome.TemperatureAndHumidityValid(hot, arid));
            Assert.IsFalse(testBiome.TemperatureAndHumidityValid(cold, humid));
            Assert.IsFalse(testBiome.TemperatureAndHumidityValid(cold, arid));
            Assert.IsTrue(testBiome.TemperatureAndHumidityValid(hot, humid));

            testBiome.AddTemperature(cold);
            Assert.IsTrue(testBiome.TemperatureAndHumidityValid(hot, arid));
            Assert.IsTrue(testBiome.TemperatureAndHumidityValid(cold, humid));
            Assert.IsTrue(testBiome.TemperatureAndHumidityValid(cold, arid));
            Assert.IsTrue(testBiome.TemperatureAndHumidityValid(hot, humid));
        }
Example #2
0
        public void AddTemperatureTest()
        {
            Biome testBiome = new Biome("test");

            Assert.AreEqual(0, testBiome.TemperatureRange.Count);
            testBiome.AddTemperature(Hex.TemperatureLevel.Hot);
            Assert.AreEqual(1, testBiome.TemperatureRange.Count);
            Assert.IsTrue(testBiome.TemperatureRange.Contains(Hex.TemperatureLevel.Hot));
            Assert.IsFalse(testBiome.TemperatureRange.Contains(Hex.TemperatureLevel.Cold));
            testBiome.AddTemperature(Hex.TemperatureLevel.Hot);
            Assert.AreEqual(1, testBiome.TemperatureRange.Count);
            testBiome.AddTemperature(Hex.TemperatureLevel.Cold);
            Assert.AreEqual(2, testBiome.TemperatureRange.Count);
            Assert.IsTrue(testBiome.TemperatureRange.Contains(Hex.TemperatureLevel.Hot));
            Assert.IsTrue(testBiome.TemperatureRange.Contains(Hex.TemperatureLevel.Cold));
        }