Example #1
0
        public void NextAvailable_AvailableToyOrders_ReturnsCorrectTime(string toyOrderString, int year, int month, int day, int hour, int minute)
        {
            ToyOrder toy = new ToyOrder(toyOrderString);

            Elf      elf          = new Elf(1);
            DateTime shouldFinish = new DateTime(year, month, day, hour, minute, 0);

            elf.BuildToy(toy);

            Assert.AreEqual(shouldFinish, elf.nextAvailable, TestContext.CurrentContext.Test.Name);
        }
Example #2
0
        public void Productivity_VariousOrders_UpdatesProductivity(string toyOrderString, double sanctionedHours, double unsanctionedHours)
        {
            ToyOrder toy = new ToyOrder(toyOrderString);

            Elf elf = new Elf(1);

            elf.BuildToy(toy);

            double expectedProductivity = 1 * Math.Pow(Elf.FACTOR_SANCTIONED, sanctionedHours) * Math.Pow(Elf.FACTOR_UNSANCTIONED, unsanctionedHours);

            Assert.AreEqual(expectedProductivity, elf.productivity);
        }