public void CalculatePremiumTest() { SmartInsuranceRepository smartRepo = new SmartInsuranceRepository(); int actual = smartRepo.CalculatePremium(3, 1, 2, 1); int expected = (225); Assert.AreEqual(expected, actual); }
private void RunMenu() { bool running = true; while (running) { Console.WriteLine("Welcome to the Smart Insurance monthly premium calculations app. Please enter the information recieved from smart car. Hit the Enter key to continue."); string input = Console.ReadLine(); bool speeds = FollowsSpeedLimit(); int timesSpentSpeeding = 0; if (speeds) { timesSpentSpeeding = TimesPerMonthSpeeding(); } int timesFollowedTooClosely = TimesFollowedTooClosely(); int timesSwervedOutsideOfLane = TimesSwervedOutsideOfLane(); int timesRolledThroughStopSign = TimesRolledThroughStopSign(); int calculatePremium = _SmartIRepo.CalculatePremium(timesSpentSpeeding, timesFollowedTooClosely, timesSwervedOutsideOfLane, timesRolledThroughStopSign); Console.WriteLine($"The monthly premium for this customer will be: {calculatePremium}"); Console.ReadKey(); Console.Clear(); } }