public void ReturnsQuestionForGivenUserId() { INumberGenerator numberGenerator = new NumberGenerator(); ExcerciseController controller = new ExcerciseController(numberGenerator); var question = controller.Get("2"); Assert.IsNotNull(question); }
public void DefaultsUserIdAndReturnsQuestion() { INumberGenerator numberGenerator = new NumberGenerator(); ExcerciseController controller = new ExcerciseController(numberGenerator); var question = controller.Get(string.Empty); Assert.IsNotNull(question); }
public void ReducesTimeRemainingForRepeatQuestionSameUserId() { INumberGenerator numberGenerator = new NumberGenerator(); ExcerciseController controller = new ExcerciseController(numberGenerator); const string userId = "3"; var question = controller.Get(userId); Assert.IsNotNull(question); Assert.AreEqual(question.secondsRemaining, 20); var question2 = controller.Get(userId); Assert.IsNotNull(question2); Assert.AreEqual(question2.secondsRemaining, 19); var question3 = controller.Get(userId); Assert.IsNotNull(question3); Assert.AreEqual(question3.secondsRemaining, 18); }