private void ViewAllClaims() { Console.Clear(); Queue <Claims> allClaims = _repo.GetClaims(); /// formatting doesn't look right /// need to look more into formatting columns/tables??? string headerSize = "{0,-10}{1,-8}{2,-30}{3,-10}{4,-18}{5,-15}{6,-10}"; Console.Write("\t"); Console.Write(headerSize, "Claim ID", "Type", "Description", "Amount", "Date Of Incident", "Date Of Claim", "Is Valid\n\n"); //Console.WriteLine($"Claim ID" + // $"Claim Type" + // $"Claim Description" + // $"Claim Amount" + // $"Date Of Incident" + // $"Date Of Claim" + // $"Is Claim Valid"); foreach (Claims claim in allClaims) { Console.Write("\t"); Console.Write(headerSize, $"{claim.ClaimID}", $"{claim.TypeOfClaim}", $"{claim.Description}", $"${claim.ClaimAmount}", $"{claim.DateOfIncident.ToShortDateString()}", $"{claim.DateOfClaim.ToShortDateString()}", $"{claim.IsValid}\n\n"); // look into .shortdatetostring more, removes hour/min/sec from DateTime } }
public void GetClaims_ShouldReturnClaims() { Claims claim = new Claims(); ClaimsRepo2 repo = new ClaimsRepo2(); repo.CreateNewClaim(claim); Queue <Claims> directory = repo.GetClaims(); bool directoryHasClaim = directory.Contains(claim); Assert.IsTrue(directoryHasClaim); }