public void AddNewClaim_ShouldReturnTrue() { Claims claimFive = new Claims(ClaimType.Car, 105, "Totaled Vehicle", 45000, new DateTime(2020, 10, 01), new DateTime(2020, 10, 01)); int beforeCount = _repo.GetClaimsList().Count; _repo.AddNewClaim(claimFive); int afterCount = _repo.GetClaimsList().Count; Assert.IsTrue(afterCount > beforeCount); }
//1. See all claims private void ViewAllClaims() { Console.Clear(); Queue <Claims> claimList = _claimsRepo.GetClaimsList(); Console.WriteLine($"{ "ID",-4} {"Type",-6} {"Description",-25} {"Amount",-8} {"Incident Date",-18} {"Claim Date",-18} {"IsValid",-5}"); foreach (Claims claims in claimList) { ShowAClaim(claims); } }
public void TestingGetList() { ClaimsRepo claimsRepo = new ClaimsRepo(); List <Claims> claimsList = claimsRepo.GetClaimsList(); Assert.IsNotNull(claimsList); }
private void SeeAllClaims() { Console.Clear(); List <Claims> listofClaims = _claimsRepo.GetClaimsList(); foreach (Claims claim in listofClaims) { Console.WriteLine($"Claim ID: {claim.ClaimID}\n" + $"Claim Type: {claim.TypeOfClaim}\n" + $"Description: {claim.Description}\n" + $"Amount: {claim.ClaimAmount}\n" + $"Date Of Accident: {claim.DateOfIncident}\n" + $"Date Of Claim: {claim.DateOfClaim}\n" + $"Is Valid: {claim.IsValid}\n\n"); } }
public void TestingViewByID() { ClaimsRepo claimsRepo = new ClaimsRepo(); Claims testClaim = new Claims(9, ClaimType.Home, "House Fire", 75000.00, new DateTime(2020, 11, 21), new DateTime(2020, 12, 01), true); claimsRepo.AddClaimToList(testClaim); List <Claims> claimsList = claimsRepo.GetClaimsList(); foreach (Claims claim in claimsList) { if (claim.ClaimID == testClaim.ClaimID) { Assert.IsTrue(testClaim.ClaimID == 9); } } }
public void TestingAddToList() { ClaimsRepo claimsRepo = new ClaimsRepo(); Claims testClaim = new Claims(9, ClaimType.Home, "House Fire", 75000.00, new DateTime(2020, 11, 21), new DateTime(2020, 12, 01), true); claimsRepo.AddClaimToList(testClaim); List <Claims> claimsList = claimsRepo.GetClaimsList(); bool claimIDIsEqual = false; foreach (Claims claim in claimsList) { if (claim.ClaimID == testClaim.ClaimID) { claimIDIsEqual = true; break; } } Assert.IsTrue(claimIDIsEqual); }
public void TestingWorkedOnClaim() { ClaimsRepo claimsRepo = new ClaimsRepo(); Claims testClaim = new Claims(9, ClaimType.Home, "House Fire", 75000.00, new DateTime(2020, 11, 21), new DateTime(2020, 12, 01), true); claimsRepo.AddClaimToList(testClaim); claimsRepo.WorkedOnClaim(9); List <Claims> claimsList = claimsRepo.GetClaimsList(); bool wasDeleted = true; foreach (Claims claim in claimsList) { if (claim.ClaimID == 9 || testClaim.ClaimID == 9) { wasDeleted = false; break; } } Assert.IsTrue(wasDeleted); }