public void CountMethod_ShouldReturnNotNull() { //Act int count = _claimRepo.CountMethod(); Assert.IsNotNull(count); }
//case 3 private void CreateNewClaim() { Console.Clear(); Claim newClaim = new Claim(); int counter = _claimRepo.CountMethod(); newClaim.ClaimID = System.Threading.Interlocked.Increment(ref counter); /* Console.WriteLine("Enter the Claim ID:"); * string IDAsString = Console.ReadLine(); * newClaim.ClaimID = int.Parse(IDAsString);*/ Console.WriteLine("Enter claim type:\n" + "1. Car\n" + "2. Home\n" + "3. Theft"); string typeAsString = Console.ReadLine(); int typeAsInt = int.Parse(typeAsString); newClaim.TypeOfClaim = (ClaimType)typeAsInt; Console.WriteLine("Enter a claim description:"); newClaim.Description = Console.ReadLine(); Console.WriteLine("Amount of Damage:"); string amountAsString = Console.ReadLine(); newClaim.ClaimAmount = decimal.Parse(amountAsString); Console.WriteLine("Date of Accident:"); string incidentDateAsString = Console.ReadLine(); newClaim.DateOfIncident = DateTime.Parse(incidentDateAsString); Console.WriteLine("Date of Claim:"); string claimDateAsString = Console.ReadLine(); newClaim.DateOfClaim = DateTime.Parse(claimDateAsString); /* Console.WriteLine("Is this claim valid?(Y/N)"); * string isValid = Console.ReadLine().ToLower(); * if (isValid == "y") * { * newClaim.IsValid = true; * } * else * { * newClaim.IsValid = false; * }*/ _claimRepo.AddClaimToQueue(newClaim); }