Esempio n. 1
0
        public void Should_HaveCorrectFertileLand_When_ValidSaltHasBeenAdded_Two()
        {
            var land = new Land(GetSquareMetersForLand(400, 600));

            land.AddSalt(new Rectangle(new Point(48, 192), new Point(351, 207)));
            land.AddSalt(new Rectangle(new Point(48, 392), new Point(351, 407)));
            land.AddSalt(new Rectangle(new Point(120, 52), new Point(135, 547)));
            land.AddSalt(new Rectangle(new Point(260, 52), new Point(275, 547)));

            Assert.AreEqual(2, land.FertilePlotsInSquareMeters.Count());
            Assert.IsTrue(land.FertilePlotsInSquareMeters.Contains(22816));
            Assert.IsTrue(land.FertilePlotsInSquareMeters.Contains(192608));
        }
Esempio n. 2
0
        public void Should_HaveCorrectFertileLand_When_ValidSaltHasBeenAdded_One()
        {
            var land = new Land(GetSquareMetersForLand(400, 600));

            land.AddSalt(new Rectangle(new Point(0, 292), new Point(399, 307)));

            Assert.AreEqual(2, land.FertilePlotsInSquareMeters.Count());
            Assert.AreEqual(116800, land.FertilePlotsInSquareMeters.First());
            Assert.AreEqual(116800, land.FertilePlotsInSquareMeters.Skip(1).First());
        }