public void DealWithClaim_ShouldRemoveClaim() { Claims ClaimA = new Claims(2, ClaimType.Home, "Hit and run", 2000.00m, new DateTime(2021, 02, 11), new DateTime(2021, 02, 16)); _claimRepo.EnterNewClaim(ClaimA); _claimRepo.DealWithClaim(); int expected = 1; int actual = _claimRepo.SeeAllClaims().Count; //Assert Assert.AreEqual(expected, actual); }
private void TakeCareOfNextClaim() { Console.Clear(); _02_ClaimRepo.Claims nextClaim = _claimRepo.SeeNextClaim(); Console.WriteLine("Here are the details for the next claim to be handled: "); Console.WriteLine($"Claim ID: {nextClaim.ClaimID}"); Console.WriteLine($"Type: { nextClaim.TypeOfClaim}"); Console.WriteLine($"Description: {nextClaim.Description}"); Console.WriteLine($"Amount: ${nextClaim.ClaimAmount}"); Console.WriteLine($"Date of Accident: {nextClaim.DateOfIncident.ToString("MM/dd/yyyy")}"); Console.WriteLine($"Date of Claim: {nextClaim.DateOfClaim.ToString("MM/dd/yyyy")}"); Console.WriteLine($"This Claim is Valid: {nextClaim.IsValid}"); Console.WriteLine("--------------------"); Console.WriteLine("Do you want to deal with this claim now? Type Y or N."); string userAnswer = Console.ReadLine().ToLower(); switch (userAnswer) { case "y": { _claimRepo.DealWithClaim(); Console.WriteLine("This claim has been deleted from the Directory."); break; } case "n": { Console.WriteLine("This claim has been returned to the Directory."); break; } default: { Console.WriteLine("You have pressed an invalid key. Please enter either Y or N."); break; } } Console.WriteLine("Press any key to return to the main menu: "); Console.ReadKey(); }