public void Test_EnquequeClaim() { //Arrange Claims newClaim = new Claims(); Queue <Claims> localQueue = repo.GetClaimsQueue(); int initialCount = localQueue.Count; bool wasEnqueued; //Act repo.EnquequeClaim(newClaim); wasEnqueued = (initialCount < localQueue.Count) ? true : false; //Assert Assert.IsTrue(wasEnqueued); }
private void NewClaim() { Console.Clear(); Claims newClaim = new Claims(); // Gather Properties // Claim ID Console.Write("\nEnter the claim id: "); string claimIDInput = Console.ReadLine(); newClaim.ClaimID = Convert.ToInt32(claimIDInput); // Collecting enum // Need a way to collect string and convert to enum (switch case maybe??) Console.WriteLine("\nPlease enter the number matching the type of claim: \n" + "\n1) Car" + "\n2) Home" + "\n3) Theft"); string typeOfClaimAsString = Console.ReadLine(); int typeOfClaimAsInt = int.Parse(typeOfClaimAsString); newClaim.TypeOfClaim = (ClaimType)typeOfClaimAsInt; //Description Console.Write("\nEnter a claim description: "); newClaim.Description = Console.ReadLine(); Console.Write("\nAmount of Damage: $"); string claimAmountString = Console.ReadLine(); newClaim.ClaimAmount = decimal.Parse(claimAmountString); //Dates Console.Write("\nDate of Accident: "); string accidentDateString = Console.ReadLine(); newClaim.DateOfIncident = DateTime.Parse(accidentDateString); Console.Write("\nDate of Claim: "); string claimDateString = Console.ReadLine(); newClaim.DateOfClaim = DateTime.Parse(claimDateString); // Is Valid print (if else statement/ "This claim is valid." or "This claim is not valid." Console.Write("Is Valid: " + newClaim.IsValid); repo.EnquequeClaim(newClaim); }