Esempio n. 1
0
        public void PositiveDifference()
        {
            // given
            var result = new GuessResult { correctResult = 5, guess = 4 };

            //when
            var difference = result.CalculateDifference();

            //then
            Assert.AreEqual(1, difference);
        }
Esempio n. 2
0
 private ActionResult HandleGuessResult(GuessResult result)
 {
     if (result.isCorrect())
     {
         ViewBag.Value = result.correctResult;
         ViewBag.Term = result.term;
         ViewBag.Suffix = ordinalSuffixProvider.GetSuffix(result.term);
         return View("Correct");
     }
     ViewBag.Difference = result.CalculateDifference();
     return View("Incorrect");
 }