Beispiel #1
0
        private void TakeCareOfNextClaim()
        {
            Claims nextClaim = _claimsRepo.DisplayNextClaim();

            if (nextClaim != null)
            {
                Console.WriteLine($"Claim ID: {nextClaim.ClaimID}\n" +
                                  $"Claim Type: {nextClaim.ClaimType}\n" +
                                  $"Description: {nextClaim.Description}\n" +
                                  $"Claim Amount: {nextClaim.ClaimAmount}\n" +
                                  $"Date of Incident: {nextClaim.DateOfIncident}\n" +
                                  $"Date of Claim: {nextClaim.DateOfClaim}\n" +
                                  $"Is Claim Valid: {nextClaim.IsValid}");
                Console.WriteLine("Do you want to deal with this claim now? (Please type Y/N).");
                string response = Console.ReadLine();
                if (response.ToUpper() == "Y")
                {
                    _claimsRepo.DeleteClaim();
                    Console.WriteLine("Claim was successfully removed.");
                }
                else
                {
                    Console.WriteLine("You'll deal with this claim later. \n" +
                                      "Press any key to continue......");
                    Console.ReadKey();
                    RunMenu();
                }
            }
        }
        public void DisplayNextClaim_ShouldDisplayNextClaim()
        {
            Claims     content = new Claims();
            ClaimsRepo repo    = new ClaimsRepo();

            repo.AddClaimToQueue(content);
            Queue <Claims> getTheClaimsCollection = repo.GetEntireQueue();
            Claims         getTheNextClaim        = repo.DisplayNextClaim();

            Assert.AreEqual(content, getTheNextClaim);
        }