// #3 Input Claims public void NewClaim() { Console.Clear(); ClaimLibrary newData = new ClaimLibrary(); //Claim ID Console.WriteLine("Enter Claim Number"); string ClaimID = Console.ReadLine(); newData.ClaimID = int.Parse(ClaimID); //ClaimType Console.WriteLine("Enter Claim Type Number:"); newData.ClaimType = Console.ReadLine(); //Description Console.WriteLine("Enter a drief description:"); newData.Description = Console.ReadLine(); //Settlement Console.WriteLine("Enter settlement amount:"); string settlement = Console.ReadLine(); newData.Settlement = double.Parse(settlement); //Incident Date Console.WriteLine("Enter incident date yy/mm/dd:"); string incidentDate = Console.ReadLine(); //Claim Date Console.WriteLine("Enter incident date yy/mm/dd:"); string claimDate = Console.ReadLine(); //Valid Claim Console.WriteLine("Is the claim Valid?"); string valid = Console.ReadLine().ToLower(); if (valid == "y") { newData.Valid = true; } else { newData.Valid = false; } _dataClaimsRepo.AddDataToList(newData); }
public void Arrange() { _repo = new ClaimRepo(); _data = new ClaimLibrary(1, "Car", "Car Accident on 465", 400.00, new DateTime(18, 04, 25), new DateTime(18 / 04 / 27), true); _repo.AddDataToList(_data); }
public void AddToList() { // Arrange ClaimLibrary data = new ClaimLibrary(); data.ClaimID = 1; ClaimRepo repository = new ClaimRepo(); // Act repository.AddDataToList(data); ClaimLibrary dataFromDir = repository.GetDataByClaimID(1); // Assert Assert.IsNotNull(dataFromDir); }