public void IntConstructorSingleTableEvaluateReturnsTrueWhenAnswerIsCorrect() { // Arrange const int testMultiple = 5; var engine = new MultiplicationEngine(new[] { testMultiple }); var p = engine.CreateRandomMultiplicationProblem(); p.Answer = p.Multiple * p.Multiplier; // Act bool result = engine.Evaluate(p); // Assert Assert.IsTrue(p.IsAnswered); Assert.IsTrue(result); }
public void EnumConstructorSingleTableEvaluateReturnsFalseWhenAnswerIsNotCorrect() { // Arrange const MultiplicationTable testMultiple = MultiplicationTable.Five; var engine = new MultiplicationEngine(new[] { testMultiple }); var p = engine.CreateRandomMultiplicationProblem(); p.Answer = 33; // just a number that is not a multiple of testMultiple // Act bool result = engine.Evaluate(p); // Assert Assert.IsTrue(p.IsAnswered); Assert.IsFalse(result); }