private void AddNewClaim() { Console.Clear(); ClaimsPoco newClaim = new ClaimsPoco(); Console.Write("Enter the Claim ID:"); string claimIdAsString = Console.ReadLine(); newClaim.ClaimId = int.Parse(claimIdAsString); Console.Write("Enter the Claim Type (Car, Home, Theft):"); newClaim.ClaimType = Console.ReadLine(); Console.Write("Enter the Description:"); newClaim.Description = Console.ReadLine(); Console.Write("Enter the Claim Amount:"); string claimAmount = Console.ReadLine(); newClaim.ClaimAmount = decimal.Parse(claimAmount); Console.Write("Enter Date of Incident (Format of YYYY/MM/DD):"); string incidentDate = Console.ReadLine(); newClaim.DateOfIncident = DateTime.Parse(incidentDate); Console.Write("Enter Date of Claim (Format of YYYY/MM/DD):"); string claimDate = Console.ReadLine(); newClaim.DateOfClaim = DateTime.Parse(claimDate); Console.Write("Is this claim valid? (y/n):"); string input = Console.ReadLine().ToLower(); if (input == "y") { newClaim.IsValid = true; } else if (input == "n") { newClaim.IsValid = false; } else { Console.Write("Please use y/n..."); } _claimsRepo.AddClaimsQueue(newClaim); }
public void GetThisPartyStarted() { _repo = new ClaimsRepo(); _claim = new ClaimsPoco(4, "Car", "Wreck on I-70", 2000, Convert.ToDateTime("2018/04/27"), Convert.ToDateTime("2018/04/28"), true); _repo.AddClaimsQueue(_claim); }
public void AddClaimQueue_ShouldGetNotNull() { ClaimsPoco claim = new ClaimsPoco(); claim.ClaimId = 3; ClaimsRepo repo = new ClaimsRepo(); repo.AddClaimsQueue(claim); ClaimsPoco claimFromDirectory = repo.GetClaimById(3); Assert.IsNotNull(claimFromDirectory); }