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); }
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); }