Esempio n. 1
0
        [TestCase(1, 1, -10, 0, 0, true)] //Can enter negative pass yards
        public void CanEnterValidStatsTests(decimal passesAttempted, decimal passesCompleted, decimal passingYards, decimal touchdownPasses, decimal interceptions, bool validInput)
        {
            QBRRequest request = new QBRRequest()
            {
                PassesAttempted = passesAttempted,
                PassesCompleted = passesCompleted,
                PassingYards    = passingYards,
                Interceptions   = interceptions,
                TouchdownPasses = touchdownPasses
            };
            QBRResponse response = QBRCalculations.CalculateQBR(request);

            Assert.AreEqual(validInput, response.ValidInput);
        }
Esempio n. 2
0
        public void QBRCalculationTest(string name, decimal passesAttempted, decimal passesCompleted, decimal passingYards, decimal touchdownPasses, decimal interceptions, decimal expectedQBR)
        {
            QBRRequest request = new QBRRequest()
            {
                Name            = name,
                PassesAttempted = passesAttempted,
                PassesCompleted = passesCompleted,
                PassingYards    = passingYards,
                Interceptions   = interceptions,
                TouchdownPasses = touchdownPasses
            };
            QBRResponse response = QBRCalculations.CalculateQBR(request);

            Assert.AreEqual(expectedQBR, response.Rating);
        }
 public void Start()
 {
     Greet();
     while (true)
     {
         QBRRequest  request  = TakeInStats();
         QBRResponse response = QBRCalculations.CalculateQBR(request);
         DisplayRating(response);
         bool nextRating = CalculateAnotherRating();
         if (!nextRating)
         {
             break;
         }
         Console.Clear();
     }
     Console.WriteLine("Press any key to quit...");
     Console.ReadKey();
 }