Пример #1
0
        public void EnterNewClaim()
        {
            Claims claim = new Claims();

            bool addClaim = _repo.AddClaimToDirectory(claim);

            Assert.IsTrue(addClaim);
        }
Пример #2
0
        public void Arrange()
        {
            _repo = new ClaimsRepository();
            Claims claimOne   = new Claims(1, ClaimType.Car, "Car accident on 465.", 400.00, new DateTime(2018, 04, 27), new DateTime(2018, 04, 27));
            Claims claimTwo   = new Claims(2, ClaimType.Home, "House fire in kitchen.", 4000.00, new DateTime(04 / 11 / 2018), new DateTime(04 / 12 / 2018));
            Claims claimThree = new Claims(3, ClaimType.Theft, "Stolen Pancakes.", 4.00, new DateTime(04 / 27 / 2018), new DateTime(06 / 01 / 2018));

            _repo.AddClaimToDirectory(claimOne);
            _repo.AddClaimToDirectory(claimTwo);
            _repo.AddClaimToDirectory(claimThree);
        }
Пример #3
0
        private void EnterNewClaim()
        {
            Console.Clear();
            Claims claim = new Claims();

            Console.WriteLine("New Claim Entry Log.");

            Console.WriteLine("Enter the claim ID: ");
            claim.ClaimID = int.Parse(Console.ReadLine());

            Console.WriteLine("Enter the claim type: \n" +
                              "1: Car\n" +
                              "2: Home\n" +
                              "3: Theft");
            string userInput = Console.ReadLine();

            switch (userInput)
            {
            case "1":
                claim.ClaimType = ClaimType.Car;
                break;

            case "2":
                claim.ClaimType = ClaimType.Home;
                break;

            case "3":
                claim.ClaimType = ClaimType.Theft;
                break;

            default:
                Console.WriteLine("Invalid selection. Please choose from the available options.\n" +
                                  "Press any key to continue......");
                Console.ReadKey();
                break;
            }

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

            Console.WriteLine("Enter the amount of the damage: ");
            claim.ClaimAmount = double.Parse(Console.ReadLine());


            Console.WriteLine("Enter the date of the accident using MM/DD/YYYY: ");
            claim.DateOfIncident = DateTime.Parse(Console.ReadLine());

            Console.WriteLine("Enter the date of the claim using MM/DD/YYYY: ");
            claim.DateOfClaim = DateTime.Parse(Console.ReadLine());

            _claimsDirectory.AddClaimToDirectory(claim);
        }
Пример #4
0
        public void AddClaimToDirectory_ShouldReturnTrueBoolean()
        {
            Claim            content = new Claim();
            ClaimsRepository repo    = new ClaimsRepository();

            bool addClaim = repo.AddClaimToDirectory(content);

            Assert.IsTrue(addClaim);
        }
Пример #5
0
        public void GetClaimDirectory_ShouldReturnDirectory()
        {
            Claim            content = new Claim();
            ClaimsRepository repo    = new ClaimsRepository();

            repo.AddClaimToDirectory(content);
            Queue <Claim> newContent = repo.GetAllClaims();

            bool directoryHasContent = newContent.Contains(content);

            Assert.IsTrue(directoryHasContent);
        }