public void ShowAllClaims() { Console.Clear(); //get the claims List <ClaimProperties> listOfContent = _claimMethods.GetClaims(); //Take each item and display property values foreach (ClaimProperties content in listOfContent) { Console.WriteLine($"#{content.ClaimID} \n" + $"{content.TypeOfClaim} \n" + $"{content.Description} \n" + $"${content.ClaimAmount}\n" + $"{content.DateOfIncident}\n" + $"{content.DateOfClaim}\n" + $"{content.IsValid}\n" + $"-----------------------"); } Console.WriteLine("Press any key to continue...."); Console.ReadKey(); }
public void GetClaims_ShouldReturnCorrectClaims() { //arrange ClaimMethods repo = new ClaimMethods(); ClaimProperties _claimObject = new ClaimProperties(1, ClaimType.Car, "Car Accident on 465.", 400.00, new DateTime(2018, 04, 25), new DateTime(2018, 04, 27)); repo.AddContentToRepo(_claimObject); ClaimProperties _claimObject2 = new ClaimProperties(2, ClaimType.Home, "House fire in kitchen.", 4000.00, new DateTime(2018, 04, 11), new DateTime(2018, 04, 12)); repo.AddContentToRepo(_claimObject2); ClaimProperties _claimObject3 = new ClaimProperties(3, ClaimType.Theft, "Stolen pancakes.", 4.00, new DateTime(2018, 04, 27), new DateTime(2018, 06, 01)); repo.AddContentToRepo(_claimObject3); //act List <ClaimProperties> listOfClaims = repo.GetClaims(); //assert bool repoHasContent = listOfClaims.Contains(_claimObject); Assert.IsTrue(repoHasContent); }