public void Algorithm_BlueCompare() { var algo = new BlueCompareAlgorithm(); IAward award = new BlueCompareAward(0, TimeSpan.FromDays(15)); var runner = new AwardAlgorithmRunner(algo); runner.Add(award); runner.RunAlgorithmWithDayIncrement(16); var expected = new[] { 0, 1, 2, 3, 4, 6, 8, 10, 12, 14, 17, 20, 23, 26, 29, 32, 0 }; CollectionAssert.AreEqual(expected, runner.AwardInfos[0].history); }
public void Award_BlueCompare() { // we don't explicitly test for expiration here, the behavior of this particular // award is fairly complex and relies on the expiration functionality working properly. // If the algorithm works as expected, the expiration is necessarily working as expected. // IAward award = new BlueCompareAward(0, TimeSpan.FromDays(15)); var algo = award.UpdateAlgorithm; var runner = new AwardAlgorithmRunner(algo); runner.Add(award); runner.RunAlgorithmWithDayIncrement(16); var expected = new[] { 0, 1, 2, 3, 4, 6, 8, 10, 12, 14, 17, 20, 23, 26, 29, 32, 0 }; CollectionAssert.AreEqual(expected, runner.AwardInfos[0].history); }