public void TestAll() { ClaimContent claim1 = new ClaimContent(1, "House", "Tree Fell on Roof", 500.00d, new DateTime(2019, 01, 22), new DateTime(2019, 01, 24), true); _claimRepo.AddToQueue(claim1); ClaimContent claim2 = new ClaimContent(2, "Car", "Car Accident on I-69", 250.00d, new DateTime(2019, 02, 23), new DateTime(2019, 03, 01), true); _claimRepo.AddToQueue(claim2); ClaimContent claim3 = new ClaimContent(3, "Theft", "Stolen Pancakes", 4.00d, new DateTime(2019, 03, 20), new DateTime(2019, 03, 22), false); _claimRepo.AddToQueue(claim3); //bool properlyAdded = _claimRepo.HasContent(); //Assert.IsTrue(properlyAdded); //Console.WriteLine($"{properlyAdded}"); Console.WriteLine($"{_claimRepo.ViewNextClaim()} {_claimRepo.GetClaimQueue()}"); _claimRepo.DealWithClaim(); Console.WriteLine($"{_claimRepo.ViewNextClaim()}"); _claimRepo.GetClaimQueue(); bool hasContent = _claimRepo.HasContent(); Assert.IsTrue(hasContent); int newClaimNum = _claimRepo.GetClaimNumber(); Assert.AreEqual(4, newClaimNum); }
public void TakeCareOfNextClaim() { if (_claimRepo.HasContent()) { Console.Clear(); Console.WriteLine(">Take Care of Next Claim"); //public ClaimContent content =_claimRepo.DealWithClaim(); ClaimContent content = _claimRepo.ViewNextClaim(); string[] headers = new string[] { "ClaimID", "Type", "Description of Accident", "Amount", "Date of Accident", "Date of Claim", "IsValid" }; UI_Format ConsoleFormatter = new UI_Format(1, UI_Format.Align.Left, headers); #region DATA //List<ClaimContent> string[][] data = new string[][] { new string[] { $"{content.ClaimNumber}", $"{content.ClaimType}", $"{content.ClaimDescription}", $"${content.ClaimAmount}", $"{content.DateOfAccident}", $"{content.DateOfClaim}", $"{content.IsValid}" }, }; #endregion ArrayList arr = new ArrayList(data); ConsoleFormatter.RePrint(arr); //Get data variable from the link in the description Console.WriteLine($">Would You Like to Deal With This Claim? (Y/N)"); string nextClaimInput = Console.ReadLine().ToLower(); switch (nextClaimInput) { case "y": case "yes": if (content.IsValid) { TakeCareOfClaimIsValid(content.ClaimType); } else { TakeCareOfClaimIsInValid(content.ClaimType); } break; case "n": case "no": CancelTakingCareOfClaim(content.ClaimType); break; default: ErrorOnMainClaimScreen(nextClaimInput); break; } } else { Console.Clear(); Console.WriteLine($">Take Care of Next Claim" + $"\nGood Work! All Claims Have Been Dealt With!" + $"\nLet's Work on Adding New Claims to Deal With!" + $"\nPress Enter to Return to the Main Menu..."); Console.ReadLine(); } }