예제 #1
0
        public void ForemostClaim()
        {
            Console.Clear();
            Claim nextClaim = ClaimsRepo.GetAllClaims().Peek();

            Console.WriteLine("\n" + "Here are the details of the next claim to be handled:\n" +
                              $"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 it Valid: {nextClaim.IsValid}\n" +
                              $"Do you want to deal with this claim now (y/n)?");
            string input = Console.ReadLine().ToLower();;

            if (input == "y")
            {
                ClaimsRepo._claimsList.Dequeue();
            }
            else if (input == "n")
            {
                Console.Clear();
                Menu();
            }
            else
            {
                Console.WriteLine("Please input a valid response.");
            }
        }
예제 #2
0
        private void DisplayAllClaims()
        {
            _console.Clear();
            Queue <Claims> claims = new Queue <Claims>();

            claims = _claimsRepo.GetAllClaims();
            foreach (Claims content in claims)
            {
                _console.WriteLine($"{content.ClaimID}\n" +
                                   $"{content.TypeOfClaim}\n" +
                                   $"{content.Description}\n" +
                                   $"{content.ClaimAmmount}\n" +
                                   $"{content.DateOfIncident}\n" +
                                   $"{content.DateOfClaim}\n");
            }
            _console.WriteLine("Press any key to contiune...");
            _console.ReadKey();
        }
예제 #3
0
        public void GetAllClaims_ShouldReturnNotNull()
        {
            var repo  = new ClaimsRepo();
            var claim = new Claim();

            repo.Enqueue(claim);
            List <Claim> getClaims = repo.GetAllClaims();

            Assert.IsNotNull(getClaims);
        }
예제 #4
0
        public void TestForGetAllClaimsIsNotNull()
        {
            //Arange
            ClaimsRepo claimsRepo = new ClaimsRepo();

            //Act
            Queue <Claims> listFromRepo = claimsRepo.GetAllClaims();

            //Assert
            Assert.IsNotNull(listFromRepo);
        }
예제 #5
0
        public void GetClaim_ShouldReturnCorrectClaim()
        {
            Claims     content = new Claims();
            ClaimsRepo repo    = new ClaimsRepo();

            repo.AddClaimToDirectory(content);
            Queue <Claims> contents        = repo.GetAllClaims();
            bool           claimHasContent = contents.Contains(content);

            Assert.IsTrue(claimHasContent);
        }
예제 #6
0
        //View all items in the queue
        private void ViewAllClaims()
        {
            Console.Clear();
            Queue <Claims> listOfClaims = _claimsRepo.GetAllClaims();

            foreach (Claims claim in listOfClaims)
            {
                Console.WriteLine($"ClaimID: {claim.ClaimID}\n" +
                                  $"\tType: {claim.ClaimType}\n" +
                                  $"\tDescrition: {claim.Description}\n" +
                                  $"\ttDate Of Accident: {claim.DateOfAccident}\n" +
                                  $"\tDate of Claim: {claim.DateOfClaim}\n" +
                                  $"\tIs it Valid: {claim.IsValid}");
            }
        }
예제 #7
0
        public void ViewAllClaims()
        {
            Queue <Claim> _claimsQueue = _claimsRepo.GetAllClaims();

            foreach (Claim item in _claimsQueue)
            {
                Console.WriteLine($"ClaimId: { item.ClaimID}\n" +
                                  $"Claim : {item.ClaimType}\n" +
                                  $"Description : {item.Description}\n" +
                                  $"Amount : {item.ClaimAmount}\n" +
                                  $"Date of Incident : {item.DateOfIncident}\n" +
                                  $"Date of Claim : {item.DateOfClaim}\n" +
                                  $"Is claim valid : {item.IsValid}\n" +
                                  $"");
            }

            Console.ReadLine();
        }
        public void SeeAllClaims()
        {
            Console.Clear();
            List <Claim> claimsList = new List <Claim>();

            claimsList = claims.GetAllClaims();
            foreach (Claim claim in claimsList)
            {
                Console.WriteLine($"Claim ID: {claim.ClaimID}\n" +
                                  $"Claim Type: {claim.ClaimType}\n" +
                                  $"Description: {claim.Description}\n" +
                                  $"Claim Ammount: ${claim.ClaimAmount}\n" +
                                  $"Date Of Incident: {claim.DateOfIncindent}\n" +
                                  $"Date Of Claim: {claim.DateOfClaim}\n" +
                                  $"Is Valid: {claim.IsValid}\n" +
                                  $"");
            }

            //claims.DisplayAllClaims();
            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();
            MainMenu();
        }