Exemple #1
0
        private void SeedData()
        {
            var walden = new Claim(ClaimOptions.Car, "the car hit the block", 277.67, new DateTime(2020, 3, 15), new DateTime(2020, 3, 16), true);
            var Kit    = new Claim(ClaimOptions.Home, "Hell danmaged the roof", 1500.52, new DateTime(2020, 5, 19), new DateTime(2020, 05, 20), true);
            var Bob    = new Claim(ClaimOptions.Renter, "Home got fire", 600.21, new DateTime(2020, 09, 21), new DateTime(2020, 09, 22), true);

            _claimRepo.AddClaimToDirectory(walden);
            _claimRepo.AddClaimToDirectory(Bob);
            _claimRepo.AddClaimToDirectory(Kit);
        }
Exemple #2
0
        public void Seed()
        {
            Claim Ashley = new Claim("460", ClaimType.HomeBurglary, "Stolen pancakes.", 1000.00m, new DateTime(2021, 01, 25), new DateTime(2021, 02, 05), true);

            Claim Bob = new Claim("461", ClaimType.CustomerInjury, "My professor hit me with his car.", 1000.00m, new DateTime(2021, 02, 14), new DateTime(2021, 02, 18), true);

            Claim Andrew = new Claim("462", ClaimType.HomeFire, "One of my students set my home on fire, and while I tried to back out of my driveway to save my car, I ran him over.", 1000.00m, new DateTime(2021, 02, 14), new DateTime(2021, 02, 18), true);

            _repo.AddClaimToDirectory(Ashley);
            _repo.AddClaimToDirectory(Bob);
            _repo.AddClaimToDirectory(Andrew);
        }
        public void NewClaimTestMethod()
        {
            //Arrenge
            ClaimRepo repo   = new ClaimRepo();
            Claim     toTest = new Claim(ClaimOptions.Car, "the car hit the block", 277.67, new DateTime(2020, 3, 15), new DateTime(2020, 3, 16), true);

            //Act -
            repo.AddClaimToDirectory(toTest);
        }
        public void AddClaim()
        {
            ClaimProp claim         = new ClaimProp();
            ClaimRepo repoDirectory = new ClaimRepo();

            bool addResult = repoDirectory.AddClaimToDirectory(claim);

            Assert.IsTrue(addResult);
        }
        public void AddItemForTest()
        {
            List <string> ingred = new List <string> {
                "Green", "Red", "Yellow"
            };

            _repo    = new ClaimRepo();
            _content = new ClaimProp(12342, ClaimType.Car, "Missing Steering Wheel", "$400", Convert.ToDateTime("5/12/19"), Convert.ToDateTime("5/22/19"));
            _repo.AddClaimToDirectory(_content);
        }
Exemple #6
0
        public void AddClaims_ShouldAddNewClaimsToDirectory()
        {
            ClaimItems claimExample = new ClaimItems(7, ClaimType.Home, "Claim example", 123.45m, new DateTime(2020, 01, 01), new DateTime(2020, 02, 01));

            bool addedClaim = _claimRepo.AddClaimToDirectory(claimExample);

            Console.WriteLine(_claimRepo.Count);
            Console.WriteLine(addedClaim);
            Console.WriteLine(claimExample.Description);

            Assert.IsTrue(addedClaim);
        }
Exemple #7
0
        private void CreateNewClaim()
        {
            Console.Clear();

            ClaimItems claim = new ClaimItems();

            Console.WriteLine("Enter an ID number for the Claim");
            claim.ClaimID = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Select a claim type:\n" +
                              "1.  Car\n" +
                              "2. Home\n" +
                              "3. Theft\n");

            double claimItem = Convert.ToInt32(Console.ReadLine());

            claim.ClaimType = (ClaimType)claimItem;

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

            Console.WriteLine("Enter the amount of the claim:\n" +
                              "$ ");
            claim.ClaimAmount = Convert.ToDecimal(Console.ReadLine());

            Console.WriteLine("Enter the date of the incident:" +
                              "please use the format 'YYYY, MM, DD'\n");
            claim.DateOfIncident = Convert.ToDateTime(Console.ReadLine());

            Console.WriteLine("Enter the date the claim was filed:" +
                              "please use the format 'YYYY, MM, DD'\n");
            claim.DateOfClaim = Convert.ToDateTime(Console.ReadLine());

            _claimRepo.AddClaimToDirectory(claim);
        }
        public void TestGetBYID()
        {
            ClaimRepo claimRepo   = new ClaimRepo();
            Claim     claimToTest = new Claim(ClaimOptions.Car, "the car hit the block", 277.67, new DateTime(2020, 3, 15), new DateTime(2020, 3, 16), true);

            claimRepo.AddClaimToDirectory(claimToTest);

            //Act
            Claim byID       = claimRepo.GetClaimBYID(claimToTest.ClaimID);
            bool  claimEqual = claimToTest.Description == byID.Description;

            Assert.IsTrue(claimEqual);
        }
Exemple #9
0
        public void Seed()
        {
            _claimRepo = new ClaimRepo();
            ClaimItems carWreck        = new ClaimItems(1, ClaimType.Car, "Backed car into garage door.", 1214.53m, new DateTime(2020, 04, 12), new DateTime(2020, 05, 01));
            ClaimItems theft           = new ClaimItems(2, ClaimType.Theft, "Stole tools from garage", 2236.71m, new DateTime(2021, 01, 01), new DateTime(2021, 02, 08));
            ClaimItems hailDamage      = new ClaimItems(3, ClaimType.Home, "Hail storm", 13503.53m, new DateTime(2020, 07, 12), new DateTime(2020, 08, 01));
            ClaimItems truckHailDamage = new ClaimItems(4, ClaimType.Car, "Hail damage to body of truck", 3017.25m, new DateTime(2020, 07, 12), new DateTime(2020, 08, 01));
            ClaimItems floodDamage     = new ClaimItems(5, ClaimType.Home, "Flood damage to first two floors", 20500.53m, new DateTime(2020, 06, 12), new DateTime(2020, 08, 01));

            _claimRepo.AddClaimToDirectory(carWreck);
            _claimRepo.AddClaimToDirectory(theft);
            _claimRepo.AddClaimToDirectory(hailDamage);
            _claimRepo.AddClaimToDirectory(truckHailDamage);
            _claimRepo.AddClaimToDirectory(floodDamage);

            _claimItems = new ClaimItems(6, ClaimType.Car, "Hit by deer", 3233.23m, new DateTime(2020, 07, 07), new DateTime(2020, 08, 01));
            _claimRepo.AddClaimToDirectory(_claimItems);
        }
Exemple #10
0
        // pt 3 of prompt

        public void CreateNewClaim()
        {
            Console.Clear();
            Console.Write("Enter ClaimID: ");
            string claimID = Console.ReadLine();

            Console.Write("Enter a Claim Type (CarAccident, CarBurglary, HomeFire, HomeBurglary, or CustomerInjury: ");
            string type = Console.ReadLine();
            ClaimType Type = ClaimType.CarAccident;
            if (type == "CarAccident")
            {
                Type = ClaimType.CarAccident;
            }
            else if (type == "CarBurglary")
            {
                Type = ClaimType.CarBurglary;
            }
            else if (type == "HomeFire")
            {
                Type = ClaimType.HomeFire;
            }
            else if (type == "HomeBurglary")
            {
                Type = ClaimType.HomeBurglary;
            }
            else if (type == "CustomerInjury")
            {
                Type = ClaimType.CustomerInjury;
            }
            else
            {
                Console.WriteLine("Not A Valid Entry");
                RunMenu();
            }

            Console.Write("Describe The Claim: ");
            string description = Console.ReadLine();

            Console.Write("Amount Of Damage in $: ");
            decimal claimAmount = Convert.ToDecimal(Console.ReadLine());

            Console.Write("Date of Incident (Year, month: ");
            DateTime dateOfIncident = Convert.ToDateTime(Console.ReadLine());

            Console.Write("Date of Claim, Must Be Within 60 Days of Incident(Year, Day, Month): ");
            DateTime dateOfClaim = Convert.ToDateTime(Console.ReadLine());
            int dateTest = Convert.ToInt32((dateOfClaim - dateOfIncident).TotalDays);
            if (dateTest > 30)
            {
                Console.WriteLine("We can not accept this claim, Komodo Insurance will not accept claims made outside of a 60day window.");
                Console.ReadKey();
                RunMenu();
            }

            Console.Write("By entering this claim, you are liabile for complete honesty in your report, Press Any Key To Continue...\n");
            Console.ReadKey();

            Claim newClaim = new Claim(claimID, Type, description, claimAmount, dateOfIncident, dateOfClaim, true);

            _repo.AddClaimToDirectory(newClaim);
            Console.WriteLine("New claim has been created.");
            Console.ReadLine();
            RunMenu();
        }
 public void Arrange()
 {
     _repo  = new ClaimRepo();
     _claim = new Claim(ClaimOptions.Car, "the car hit the block", 277.67, new DateTime(2020, 3, 15), new DateTime(2020, 3, 16), true);
     _repo.AddClaimToDirectory(_claim);
 }