示例#1
0
        private void TakeCareOfClaim()
        {
            Console.Clear();
            KomodoClaim claim = _claimRepo.ViewNextClaim();

            string tableHeaders = String.Format("{0,-20} {1,-20} {2,-80} {3,-20} {4,-20} {5,-20} {6,-20}\n\n", "ID:", "Type:", "Description:", "Amount ($):", "Date of Incident:", "Date of Claim:", "Claim is Valid:");

            Console.WriteLine(tableHeaders);

            string tableBody = String.Format("{0,-20} {1,-20} {2,-80} {3,-20} {4,-20} {5,-20} {6,-20}\n\n", claim.ClaimID, claim.ClaimType, claim.Description, claim.ClaimAmount.ToString("C"), claim.DateOfIncident.ToShortDateString(), claim.DateOfClaim.ToShortDateString(), claim.IsValid);

            Console.WriteLine(tableBody);
            Console.WriteLine("\n\nDo you want to take care of this claim? Type y for yes and n for no");
            string input = Console.ReadLine().ToLower();

            switch (input)
            {
            case "y":
                _claimRepo.TakeCareOfNextClaim();
                Console.WriteLine("This claim will be removed from the queue.");
                break;

            case "n":
                Console.WriteLine("This claim will not be removed from the queue. However, you will always have to complete the queue in the order it was added. You cannot skip items in the queue.");
                break;

            default:
                Console.WriteLine("I did not understand your response.");
                break;
            }
        }
 public void ViewNextClaim_ShouldNotBeNull()
 {
     Assert.IsNotNull(_repo.ViewNextClaim());
 }