Exemplo n.º 1
0
        public void RemoveFirstItem_ShouldReturnTrue()
        {
            Claim testClaim = new Claim(2, "something", "cool", "$500", "something", "cool", false);
            bool  testHold  = _repo.AddContentToDirectory(testClaim);
            //Console.WriteLine(tes)
            Claim secondClaim = new Claim(6, "something else", "rad", "2304", "something", "doesnt matter", true);
            bool  testTwo     = _repo.AddContentToDirectory(secondClaim);

            bool removedSuccessfully = _repo.RemoveFirstClaim();

            Assert.IsTrue(removedSuccessfully);
        }
Exemplo n.º 2
0
        private void TakeCareOfNext()
        {
            Console.Clear();
            if (_claimRepo.GetAllClaims().Count() > 0)
            {
                Claim nextClaim = _claimRepo.GetAllClaims()[0];
                Console.WriteLine($"ClaimID: {nextClaim.ClaimID}\n" +
                                  $"Type: {nextClaim.Type}\n" +
                                  $"Description: {nextClaim.Description}\n" +
                                  $"Amount: {nextClaim.Amount}\n" +
                                  $"DateOfAccident: {nextClaim.DateOfAccident}\n" +
                                  $"DateOfClaim: {nextClaim.DateOfClaim}\n" +
                                  $"IsValid: {nextClaim.IsValid}");

                bool isHandled = false;

                while (!isHandled)
                {
                    Console.WriteLine("\nDo you want to deal with this claim now?(y/n)");
                    string handleClaim = Console.ReadLine();

                    switch (handleClaim)
                    {
                    case "y":
                        _claimRepo.RemoveFirstClaim();
                        isHandled = true;
                        break;

                    case "n":
                        isHandled = true;
                        break;

                    default:
                        Console.WriteLine("please enter y or n");
                        break;
                    }
                }
            }
            else
            {
                Console.WriteLine("There are no claims to check on.");
                Console.WriteLine("\nPress any key to continue...");
                Console.ReadKey();
            }
        }