public void SeedClaims()
        {
            ClaimsClass first = new ClaimsClass(1, ClaimType.Car, "car accident on I-74", 3000.52, "05/01/2020", "05/19/2020");

            _repo.EnterNewClaim(first);
            _repo.EnterNewClaim(new ClaimsClass()
            {
                ClaimID = 2, ClmType = ClaimType.Theft, Description = "Stolen TV", ClaimAmt = 1600.85, DateOfIncident = "3/13/2020", DateOfClaim = "5/20/2020"
            });
            _repo.EnterNewClaim(new ClaimsClass()
            {
                ClaimID = 3, ClmType = ClaimType.Home, Description = "Hail damage to roof", ClaimAmt = 9000.25, DateOfIncident = "5/13/2020", DateOfClaim = "5/20/2020"
            });
        }
Exemplo n.º 2
0
        //Create new Claims dialog
        private void AddNewClaim()
        {
            Console.Clear();
            ClaimsClass newclaimsClass = new ClaimsClass();

            Console.WriteLine("Enter the ClaimID: ");
            string claimNumAsString = Console.ReadLine();

            newclaimsClass.ClaimID = int.Parse(claimNumAsString);
            Console.WriteLine("Select Claim Type: \n" +
                              "1. Car\n" +
                              "2. Home\n" +
                              "3. Theft\n");
            string claimTypeInput = Console.ReadLine();

            switch (claimTypeInput)
            {
            case "1":
                newclaimsClass.ClmType = ClaimType.Car;
                break;

            case "2":
                newclaimsClass.ClmType = ClaimType.Home;
                break;

            case "3":
                newclaimsClass.ClmType = ClaimType.Theft;
                break;

            default:
                // Invalid input
                Console.ForegroundColor = ConsoleColor.DarkYellow;
                Console.WriteLine("\n\n  Please enter a valid option.");
                Console.ForegroundColor = ConsoleColor.Gray;
                Console.ReadLine();
                break;
            }
            Console.WriteLine("Enter Description: ");
            newclaimsClass.Description = Console.ReadLine();
            Console.WriteLine("Enter Claim Amount: ");
            string claimAmtAsString = Console.ReadLine();

            newclaimsClass.ClaimAmt = double.Parse(claimAmtAsString);
            Console.WriteLine("Enter Date of Incident: ");
            newclaimsClass.DateOfIncident = Console.ReadLine();
            Console.WriteLine("Enter Date Claim was Reported: ");
            newclaimsClass.DateOfClaim = Console.ReadLine();
            _claimsRepo.EnterNewClaim(newclaimsClass);
        }
Exemplo n.º 3
0
        private void EnterNewClaim()
        {
            Console.Clear();
            Claims newClaimElement = new Claims();

            Console.WriteLine("Enter Claim ID: ");
            string ClaimIdAsInt = Console.ReadLine();

            newClaimElement.ClaimId = int.Parse(ClaimIdAsInt);

            Console.WriteLine("Enter Claim Type Number:\n" +
                              "1. Car\n" +
                              "2. Home\n" +
                              "3. Theft\n");
            string typeAsString = Console.ReadLine();
            int    typeAsInt    = int.Parse(typeAsString);

            newClaimElement.TypeOfClaim = (ClaimType)typeAsInt;

            Console.WriteLine("Enter a Description of the Claim: ");
            newClaimElement.Description = Console.ReadLine();

            Console.WriteLine("Amount of Damage($USD): ");
            string amountAsString = Console.ReadLine();

            newClaimElement.ClaimAmount = double.Parse(amountAsString);

            Console.WriteLine("Date of Incident: (dd/mm/yy) ");
            newClaimElement.DateOfIncidentS = Console.ReadLine();

            Console.WriteLine("Date the Claim Was Filed: (dd/mm/yy) ");
            newClaimElement.DateOfClaimS = Console.ReadLine();

            Console.WriteLine("Valid Claim?(y/n): ");
            string isValidString = Console.ReadLine().ToLower();

            if (isValidString == "y")
            {
                newClaimElement.IsValid = true;
            }
            else
            {
                newClaimElement.IsValid = false;
            }
            _claimsRepo.EnterNewClaim(newClaimElement);
        }
        public void SeeAllClaims_ShouldDisplayAllClaims()
        {
            Claims     testClaim = new Claims();
            ClaimsRepo testRepo  = new ClaimsRepo();

            testRepo.EnterNewClaim(testClaim);

            Queue <Claims> testQueue          = testRepo.SeeAllClaims();
            bool           directoryHasClaims = testQueue.Contains(testClaim);

            Assert.IsTrue(directoryHasClaims);
        }
Exemplo n.º 5
0
        public void EnterNewClaim_NotNull()
        {
            Claims element = new Claims();

            element.ClaimId = 4;
            ClaimsRepo repo = new ClaimsRepo();

            repo.EnterNewClaim(element);
            Claims getClaimId = repo.GetClaimByID(4);

            Assert.IsNotNull(getClaimId);
        }
        public void DealWithClaim_ShouldRemoveClaim()
        {
            Claims ClaimA = new Claims(2, ClaimType.Home, "Hit and run", 2000.00m, new DateTime(2021, 02, 11), new DateTime(2021, 02, 16));

            _claimRepo.EnterNewClaim(ClaimA);
            _claimRepo.DealWithClaim();

            int expected = 1;
            int actual   = _claimRepo.SeeAllClaims().Count;

            //Assert
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 7
0
        private void EnterNewClaim()
        {
            Console.Clear();
            _02_ClaimRepo.Claims claimAdded = new _02_ClaimRepo.Claims();
            Console.WriteLine("Enter the Claim ID: ");
            int claimID = int.Parse(Console.ReadLine());

            claimAdded.ClaimID = claimID;

            Console.WriteLine("Enter the Claim Type: \n" +
                              "1. Car \n" +
                              "2. Home \n" +
                              "3. Theft\n");
            int claimType = int.Parse(Console.ReadLine());

            claimAdded.TypeOfClaim = (ClaimType)claimType;

            Console.WriteLine("Enter a Claim Description: ");
            claimAdded.Description = Console.ReadLine();

            Console.WriteLine("Amount of Damage: ");
            string damageAmount = Console.ReadLine();

            claimAdded.ClaimAmount = decimal.Parse(damageAmount);

            Console.WriteLine("Date of Accident (yyyy, mm, dd): ");
            string accidentDate = Console.ReadLine();

            claimAdded.DateOfIncident = DateTime.Parse(accidentDate);

            Console.WriteLine("Date of Claim (yyyy, mm, dd): ");
            string claimDate = Console.ReadLine();

            claimAdded.DateOfClaim = DateTime.Parse(claimDate);

            _claimRepo.EnterNewClaim(claimAdded);
            Console.WriteLine("Press any key to return to the main menu: ");
            Console.ReadKey();
        }
 public void Arrange()
 {
     _claimRepo = new ClaimsRepo();
     _claim     = new Claims(1, ClaimType.Car, "Tree falls on house", 7000.00m, new DateTime(2021, 02, 16), new DateTime(2021, 02, 16));
     _claimRepo.EnterNewClaim(_claim);
 }
Exemplo n.º 9
0
 public void ClaimsArranged()
 {
     _claimsRepo = new ClaimsRepo();
     _claims     = new Claims(1, ClaimType.Car, "Rear-ended on Southport and Emerson.", 475.00, "08/10/20", "8/15/20", true);
     _claimsRepo.EnterNewClaim(_claims);
 }