private void PeakNextClaimInQueue() { ClaimQueue claim = _claimsRepo.PeakNextClaimInQueue(); if (claim == null) { Console.WriteLine("No available claims"); } else { Console.WriteLine($"Claim ID: {claim.ClaimID} \n" + $"Type of Claim: {claim.TypeOfClaim} \n" + $"Claim Description: {claim.ClaimDescription}\n" + $"Claim Amount: {claim.ClaimAmount}\n" + $"Date of Incident: {claim.DateOfIncident.Date}\n" + $"Date of Claim: {claim.DateOfClaim.Date}\n" + $"Claim is Valid: {claim.IsValid}"); Console.WriteLine("Do you want to deal with this y or n ?"); string userInput = Console.ReadLine().ToLower(); if (userInput == "y") { _claimsRepo.ProcessClaim(); } else { RunMenu(); } } Console.ReadKey(); }
public void MyTestMethod() { ClaimQueue claim = new ClaimQueue(); Console.WriteLine(claim.ClaimID); Console.WriteLine(claim.ClaimID); Console.WriteLine(claim.ClaimID); }
public void AddItemtoQueue() { ClaimQueue claimClass = new ClaimQueue(); ClaimsRepo claimsRepo = new ClaimsRepo(); bool added = claimsRepo.AddItemsToQueue(claimClass); Assert.IsTrue(added); Console.WriteLine(added); }
public void ReadFullQueueTest() { ClaimQueue claimClass = new ClaimQueue(); ClaimsRepo claimsRepo = new ClaimsRepo(); claimsRepo.AddItemsToQueue(claimClass); Queue <ClaimQueue> claimobjects = claimsRepo.ReadFullQueue(); bool queuehasobjects = claimobjects.Contains(claimClass); Assert.IsTrue(queuehasobjects); Console.WriteLine(queuehasobjects); }
public void ReadByClaimID() { ClaimQueue claim; ClaimQueue claimClass = new ClaimQueue(); ClaimsRepo claimsRepo = new ClaimsRepo(); ClaimQueue claimone = new ClaimQueue(ClaimType.Car, "burned to the ground", 20.20, new DateTime(2020, 3, 22), new DateTime(2020, 3, 30)); ClaimQueue claimtwo = new ClaimQueue(ClaimType.Theft, "crashed into pole", 20.30, new DateTime(2020, 3, 22), new DateTime(2020, 5, 31)); claimsRepo.AddItemsToQueue(claimone); claimsRepo.AddItemsToQueue(claimtwo); claim = claimsRepo.ReadClaimByID(claimone.ClaimID); Console.WriteLine(claim.ClaimID); Assert.AreEqual(claim.ClaimDescription, "burned to the ground"); }
private void AddItemsToQueue() { Console.Clear(); ClaimQueue claimqueue = new ClaimQueue(); Console.WriteLine("Page: Add New Claim"); Console.WriteLine("Enter type of claim: \n" + "1: Car\n" + "2: Home\n" + "3: Theft"); string claimType = Console.ReadLine(); switch (claimType) { case "1": claimqueue.TypeOfClaim = ClaimType.Car; break; case "2": claimqueue.TypeOfClaim = ClaimType.Home; break; case "3": claimqueue.TypeOfClaim = ClaimType.Theft; break; } Console.WriteLine("Enter claim description:"); claimqueue.ClaimDescription = Console.ReadLine(); Console.WriteLine("Enter claim amount (example: 2200.99):"); claimqueue.ClaimAmount = double.Parse(Console.ReadLine()); Console.WriteLine("Enter the incident date in the format: month/day/year"); string incidentDate = Console.ReadLine(); DateTime incidentPass = DateTime.Parse(incidentDate); claimqueue.DateOfIncident = incidentPass; Console.WriteLine("Enter the claim creation date format: month/day/year"); string claimDate = Console.ReadLine(); DateTime claimDatePass = DateTime.Parse(claimDate); claimqueue.DateOfClaim = claimDatePass; _claimsRepo.AddItemsToQueue(claimqueue); }
public void PeakTest() { claim = claimsRepo.PeakNextClaimInQueue(); Assert.AreEqual(claim.ClaimDescription, "burned to the ground"); Console.WriteLine(claim.ClaimDescription); }
public void MyTestMethodone() { claim = claimsRepo.ReadClaimByID(claimone.ClaimID); Console.WriteLine(claim.ClaimID); }
public void Arrange() { claimsRepo = new ClaimsRepo(); claimone = new ClaimQueue(ClaimType.Car, "burned to the ground", 20.20, new DateTime(2020, 3, 22), new DateTime(2020, 3, 30)); claimsRepo.AddItemsToQueue(claimone); }
private void SeedClaimList() { ClaimQueue thisone = new ClaimQueue(ClaimType.Car, "no tires", 2000.20, new DateTime(2000, 12, 2), new DateTime(2000, 12, 20)); _claimsRepo.AddItemsToQueue(thisone); }