コード例 #1
0
        private void GetNextClaim()
        {
            KomodoClaims list = _claimRepo.PeekNextContent();

            Console.WriteLine($"Here are the details for the next claim to be handled\n" +
                              $"ClaimID: {list.ClaimID}\n" +
                              $"Type: {list.ClaimType}\n" +
                              $"Description: {list.Description}\n" +
                              $"Amount: {list.ClaimAmount}\n" +
                              $"Date Of Incident: {list.DateOfIncident}\n" +
                              $"Date Of Claim: {list.DateOfClaim}\n" +
                              $"IsValid: {list.IsValid}\n" +
                              $"Would you like to take this claim? (Y/N)");
            string choice = Console.ReadLine().ToLower();

            switch (choice)
            {
            case "y":
            case "yes":
                KomodoClaims list2 = _claimRepo.GetNextContent();
                break;

            default:
                break;
            }
        }
コード例 #2
0
        public void GetNextContentTest()
        {
            KomodoClaimsRepository queueRepo = new KomodoClaimsRepository();
            KomodoClaims           content   = new KomodoClaims(1, ClaimType.Home, "Bad stuff happened", 400.34m, new DateTime(1989, 05, 19), new DateTime(1989, 5, 23), true);
            KomodoClaims           content2  = new KomodoClaims(2, ClaimType.Car, "Big Boom", 400.34m, new DateTime(2018, 05, 19), new DateTime(2018, 9, 23), false);

            queueRepo.AddToQueue(content);
            queueRepo.AddToQueue(content2);
            queueRepo.GetNextContent();
            Queue <KomodoClaims> list = queueRepo.GetAllQueue();

            var expected = 1;
            var actual   = list.Count;

            Assert.AreEqual(expected, actual);
        }