private void NewClaim() { Console.Clear(); ClaimsContent enterClaim = new ClaimsContent(); Console.WriteLine("Enter the claim ID:"); string claimIdAsString = Console.ReadLine(); enterClaim.ClaimsID = int.Parse(claimIdAsString); Console.WriteLine("Enter the claim type(1, 2, or 3):"); string claimInput = Console.ReadLine(); int claimID = int.Parse(claimInput); enterClaim.TypeOfClaim = (ClaimsType)claimID; Console.WriteLine("Enter a claim description:"); enterClaim.Description = Console.ReadLine(); Console.WriteLine("Amount of damage(no $ necessary)"); string amountAsString = Console.ReadLine(); enterClaim.ClaimAmount = decimal.Parse(amountAsString); Console.WriteLine("Date of Accident(YYYY,MM,DD):"); enterClaim.DateOfIncident = DateTime.Parse(Console.ReadLine()); Console.WriteLine("Date of Claim(YYYY,MM,DD:"); enterClaim.DateOfClaim = DateTime.Parse(Console.ReadLine()); _claimsRepo.AddClaimToQueue(enterClaim); }
public void AddClaimToQueue_ShouldAddToQueue() { ClaimsContent content = new ClaimsContent(); ClaimsContentRepo repo = new ClaimsContentRepo(); bool wasAdded = repo.AddClaimToQueue(content); Assert.IsTrue(wasAdded); }
public void GetContentByQueue_ShouldBeCorrectTrue() { ClaimsContent content = new ClaimsContent(); ClaimsContentRepo repo = new ClaimsContentRepo(); repo.AddClaimToQueue(content); Queue <ClaimsContent> testQueue = repo.GetContentFromQueue(); bool queueHasContent = testQueue.Contains(content); Assert.IsTrue(queueHasContent); }
public void NextClaim_ShouldBeCorrect() { _repo = new ClaimsContentRepo(); Queue <ClaimsContent> _queueofclaims = new Queue <ClaimsContent>(); _content = new ClaimsContent(); _content.ClaimsID = 1; _repo.AddClaimToQueue(_content); int test = 1; ClaimsContent claim = _repo.NextClaim(); int actual = claim.ClaimsID; Assert.AreEqual(actual, test); }