private void EnterNewClaim() { Console.Clear(); Claim claim = new Claim(); Console.WriteLine("Enter a claim ID"); claim.ClaimID = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Enter a claim type \n" + "1. Car\n " + "2. Home\n " + "3. Theft\n "); string claimString = Console.ReadLine(); int claimTypeId = int.Parse(claimString); claim.ClaimType = (ClaimType)claimTypeId; Console.WriteLine("Enter a description"); claim.ClaimDescription = Console.ReadLine(); Console.WriteLine("Enter the amount of damage"); claim.ClaimAmount = double.Parse(Console.ReadLine()); Console.WriteLine("Enter date of the accident"); claim.DateOfAccident = Console.ReadLine(); _repo.AddClaimToRepo(claim); }
public void Seed() { _repo = new Claims_Repo(); Claim newClaim1 = new Claim(1, ClaimType.Car, "Crashed into tree", 4500.00, "04/26/18"); _repo.AddClaimToRepo(newClaim1); _claim = new Claim(5, ClaimType.Home, "Water pipe burst", 5000.00, "08/09/18"); _repo.AddClaimToRepo(_claim); }
public void AddTest() { Claim claim = new Claim(8, ClaimType.Theft, "Stolen phone", 500.00, "08/10/18"); bool wasAdded = _repo.AddClaimToRepo(claim); Console.WriteLine(_repo.Count); Console.WriteLine(wasAdded); Console.WriteLine(claim.ClaimID); Assert.IsTrue(wasAdded); }