public void AddClaimCountShouldIncrease() { int initialCount = _repo.ShowAllClaims().Count; ClaimsClass fourth = new ClaimsClass(4, ClaimType.Car, "Accident on Stop 11", 600.75, "3/30/2019", "5/12/2020"); _repo.EnterNewClaim(fourth); int newCount = _repo.ShowAllClaims().Count; Assert.AreNotEqual(initialCount, newCount); }
// SeedClaims private void SeedClaims() { ClaimsClass first = new ClaimsClass(1, ClaimType.Car, "car accident on I-74", 8000.53, "05/01/2020", "05/19/2020"); ClaimsClass second = new ClaimsClass(2, ClaimType.Car, "Accident on Stop 11", 600.75, "3/30/2020", "5/12/2020"); _claimsRepo.EnterNewClaim(first); _claimsRepo.EnterNewClaim(second); _claimsRepo.EnterNewClaim(new ClaimsClass() { ClaimID = 3, ClmType = ClaimType.Home, Description = "Hail damage to roof", ClaimAmt = 9000.25, DateOfIncident = "5/13/2020", DateOfClaim = "5/20/2020" }); //Console.WriteLine(_claimsQueue.Count); }
public void SeedClaims() { ClaimsClass first = new ClaimsClass(1, ClaimType.Car, "car accident on I-74", 3000.52, "05/01/2020", "05/19/2020"); _repo.EnterNewClaim(first); _repo.EnterNewClaim(new ClaimsClass() { ClaimID = 2, ClmType = ClaimType.Theft, Description = "Stolen TV", ClaimAmt = 1600.85, DateOfIncident = "3/13/2020", DateOfClaim = "5/20/2020" }); _repo.EnterNewClaim(new ClaimsClass() { ClaimID = 3, ClmType = ClaimType.Home, Description = "Hail damage to roof", ClaimAmt = 9000.25, DateOfIncident = "5/13/2020", DateOfClaim = "5/20/2020" }); }
//Create new Claims dialog private void AddNewClaim() { Console.Clear(); ClaimsClass newclaimsClass = new ClaimsClass(); Console.WriteLine("Enter the ClaimID: "); string claimNumAsString = Console.ReadLine(); newclaimsClass.ClaimID = int.Parse(claimNumAsString); Console.WriteLine("Select Claim Type: \n" + "1. Car\n" + "2. Home\n" + "3. Theft\n"); string claimTypeInput = Console.ReadLine(); switch (claimTypeInput) { case "1": newclaimsClass.ClmType = ClaimType.Car; break; case "2": newclaimsClass.ClmType = ClaimType.Home; break; case "3": newclaimsClass.ClmType = ClaimType.Theft; break; default: // Invalid input Console.ForegroundColor = ConsoleColor.DarkYellow; Console.WriteLine("\n\n Please enter a valid option."); Console.ForegroundColor = ConsoleColor.Gray; Console.ReadLine(); break; } Console.WriteLine("Enter Description: "); newclaimsClass.Description = Console.ReadLine(); Console.WriteLine("Enter Claim Amount: "); string claimAmtAsString = Console.ReadLine(); newclaimsClass.ClaimAmt = double.Parse(claimAmtAsString); Console.WriteLine("Enter Date of Incident: "); newclaimsClass.DateOfIncident = Console.ReadLine(); Console.WriteLine("Enter Date Claim was Reported: "); newclaimsClass.DateOfClaim = Console.ReadLine(); _claimsRepo.EnterNewClaim(newclaimsClass); }
//Process next Claim private void AddressNextClaim() { Console.Clear(); ClaimsClass show = _claimsRepo.Peek(); // _claimsRepo.Peek(); Console.WriteLine($"\n\n\n ClaimID: {show.ClaimID}\n\n Type: {show.ClmType}\n\n Desc: {show.Description}\n\n Amount of Claim: ${show.ClaimAmt}\n\n Date of Incident: {show.DateOfIncident}\n\n Date of Claim: {show.DateOfClaim} "); Console.ForegroundColor = ConsoleColor.DarkRed; Console.WriteLine("\n\nWould you like to process this claim?"); Console.ForegroundColor = ConsoleColor.Gray; Console.WriteLine("\n 1. Y \n 2. N"); string processChoice = Console.ReadLine(); switch (processChoice) { case "1": case "Y": case "y": case "yes": case "Yes": Console.Clear(); _claimsRepo.DequeueClaim(); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("\n Claim Processed\n\n"); Console.ForegroundColor = ConsoleColor.Gray; break; case "2": case "N": case "n": case "no": case "No": break; default: Console.ForegroundColor = ConsoleColor.DarkYellow; Console.WriteLine("\n\n Please enter a valid option."); Console.ForegroundColor = ConsoleColor.Gray; Console.ReadLine(); break; } }
public void GetPeekClaimsShouldGetContent() { ClaimsClass testContent = _repo.Peek(); Assert.AreEqual(3000.52, testContent.ClaimAmt); }