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 SeeAllClaims() { Console.Clear(); Queue <ClaimContent> claimQueue = _claimRepo.GetClaimQueue(); 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> List <string[]> claimInfo = new List <string[]>(); foreach (var claim in claimQueue) { claimInfo.Add(new string[] { $"{claim.ClaimNumber}", $"{claim.ClaimType}", $"{claim.ClaimDescription}", $"${claim.ClaimAmount}", $"{claim.DateOfAccident}", $"{claim.DateOfClaim}", $"{claim.IsValid}" }); } //foreach (ClaimContent content in claimQueue) //{ string[][] data = claimInfo.ToArray(); //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(); //} //Console.Clear(); //Console.WriteLine($"\t>See All Claims"); //Console.WriteLine($"ClaimID\tType\tDescription\t\tAmount\tDate of Accident\tDate of Claim\tIs Valid"); //foreach (ClaimContent content in claimQueue) //{ // Console.WriteLine($"\n{content.ClaimNumber}\t{content.ClaimType}\t{content.ClaimDescription}\t${content.ClaimAmount}\t{content.DateOfAccident}\t{content.DateOfClaim}\t{content.IsValid}"); //} Console.WriteLine($"\n\nEnd of Claims..." + $"\n Press Enter To Return To Menu..."); Console.ReadLine(); }