コード例 #1
0
        private void AddNewContent()
        {
            ClaimContents content = new ClaimContents();

            Console.WriteLine("Hello there, please enter a claim ID.");
            content.ID = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("What is the claim type?\n" +
                              "1. Car\n" +
                              "2. Home\n" +
                              "3.Theft");

            string TypeOfClaim = Console.ReadLine();

            Console.WriteLine("Enter a Description");
            content.Description = Console.ReadLine();

            Console.WriteLine("What is the Claim Amount?");
            content.ClaimAmount = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("What date did the incident occur on?");
            content.DateOfIncident = Convert.ToDateTime(Console.ReadLine());

            Console.WriteLine("What date was the claim?");
            content.DateOfClaim = Convert.ToDateTime(Console.ReadLine());

            _Repo.AddContentToDirectory(content);
            Console.WriteLine("Your content has been added! Press any key to return to the main menu");
            Console.ReadKey();
        }
コード例 #2
0
        public void GetClaimList_NotBeNull()
        {
            ClaimContentRepo cRepo  = new ClaimContentRepo();
            ClaimContents    cClaim = new ClaimContents();

            Queue <ClaimContents> listOfClaimsQ = cRepo.GetListOfClaims();

            Assert.IsNotNull(listOfClaimsQ);
        }
コード例 #3
0
ファイル: ClaimUI.cs プロジェクト: biwunze/GoldBadgeProject
        public void QClaimSeeds()
        {
            Queue <ClaimContents> _listOfClaimsQ = new Queue <ClaimContents>();
            ClaimContents         claimOne       = new ClaimContents(1, ClaimType.Car, "Car accident on 465.", 400.00, new DateTime(2018, 04, 25), new DateTime(2018, 4, 27), true);
            ClaimContents         claimOTwo      = new ClaimContents(2, ClaimType.Home, "House fire in kitchen.", 4000.00, new DateTime(2018, 11, 18), new DateTime(2018, 12, 18), true);
            ClaimContents         claimThree     = new ClaimContents(3, ClaimType.Theft, "Stolen pancakes.", 4.00, new DateTime(2018, 4, 27), new DateTime(2018, 06, 01), false);

            _claimContentRepo.AddClaimToQue(claimOne);
            _claimContentRepo.AddClaimToQue(claimOTwo);
            _claimContentRepo.AddClaimToQue(claimThree);
        }
コード例 #4
0
        public void DeleteClaim_True()
        {
            ClaimContentRepo cRepo  = new ClaimContentRepo();
            ClaimContents    cClaim = new ClaimContents(7, ClaimType.Car, "Car accident on 37.", 100.00, new DateTime(2018, 06, 20), new DateTime(2018, 6, 28), true);

            cRepo.AddClaimToQue(cClaim);

            bool deletedTest = cRepo.DeleteClaim(cClaim.ClaimID);

            Assert.IsTrue(deletedTest);
        }
コード例 #5
0
ファイル: ClaimUI.cs プロジェクト: biwunze/GoldBadgeProject
        private void CreateAClaim()
        {
            Console.Clear();
            ClaimContents newClaim = new ClaimContents();

            Console.WriteLine("Please enter the Claim ID number:");
            string newIDNum = Console.ReadLine();

            newClaim.ClaimID = int.Parse(newIDNum);

            Console.WriteLine("Which type of claim is this?\n" +
                              "1) Car\n" +
                              "2) Home\n" +
                              "3) Theft");

            string claimTypeString = Console.ReadLine();
            int    typeAsString    = int.Parse(claimTypeString);

            newClaim.TypeOfClaim = (ClaimType)typeAsString;

            Console.WriteLine("Please enter a brief description:");
            newClaim.ClaimDescription = Console.ReadLine();

            Console.WriteLine("What is the amount of damage?");
            string costAsString = Console.ReadLine();

            newClaim.ClaimAmount = double.Parse(costAsString);

            Console.WriteLine("On what date did the accident occur? etc: (5/11/2018)");
            string doaAsString = Console.ReadLine();

            newClaim.DateOfIncident = DateTime.Parse(doaAsString);

            Console.WriteLine("When was the claim recieved? ex: (5/20/2018)");
            string docAsString = Console.ReadLine();

            newClaim.DateOfClaim = DateTime.Parse(docAsString);

            Console.WriteLine("Was this a valid claim? (Yes or No)");
            string isValidClaim = Console.ReadLine().ToLower();

            if (isValidClaim == "yes")
            {
                newClaim.IsValid = true;
            }
            else
            {
                newClaim.IsValid = false;
            }

            _claimContentRepo.AddClaimToQue(newClaim);
        }
コード例 #6
0
        public void TestGetByClaimID()
        {
            ClaimContentRepo cRepo  = new ClaimContentRepo();
            ClaimContents    cClaim = new ClaimContents(7, ClaimType.Car, "Car accident on 37.", 100.00, new DateTime(2018, 06, 20), new DateTime(2018, 6, 28), true);

            cRepo.AddClaimToQue(cClaim);

            ClaimContents claimByID = cRepo.GetClaimByClaimID(cClaim.ClaimID);

            bool idNumsEq = cClaim.ClaimID == claimByID.ClaimID;

            Assert.IsTrue(idNumsEq);
        }
コード例 #7
0
        public void AddToClaimQ_ShouldGetNotNull()
        {
            ClaimContentRepo cRepo  = new ClaimContentRepo();
            ClaimContents    cClaim = new ClaimContents(7, ClaimType.Car, "Car accident on 37.", 100.00, new DateTime(2018, 06, 20), new DateTime(2018, 6, 28), true);

            cRepo.AddClaimToQue(cClaim);

            Queue <ClaimContents> listOfClaimsQ = cRepo.GetListOfClaims();

            bool claimNumEq = false;

            foreach (ClaimContents claims in listOfClaimsQ)
            {
                if (claims.ClaimID == cClaim.ClaimID)
                {
                    claimNumEq = true;
                    break;
                }
            }
            Assert.IsTrue(claimNumEq);
        }
コード例 #8
0
        private void DeleteLastContent()
        {
            ClaimContents peek = _Repo.PeekContent();

            //We want to view the details of the next claim in the queue, we do that with the queue.Peek() method
            Console.WriteLine("Would you like to deal with this claim now(y/n)?)");
            string userInput = Console.ReadLine();

            if (userInput.Contains("y"))
            {
                _Repo.GetLastContent();
            }
            else
            {
                Console.WriteLine("The claim will be handled later");
                Console.ReadKey();
            }


            //take some input from the user, write a conditional to evaluate their input
            //Call our dequeue method to "take care of" that claim
        }