private void KomodoInsuranceUpdate()
        {
            _InsuranceRepo.AddInsuranceToList(_Insurance);

            KomodoInsurance newInsurance = new KomodoInsurance(4, KomodoInsurance.ClaimType.Robbery, "The Robber Stole all my soup.", 4, new DateTime(2019, 06, 18), new DateTime(2019, 06, 18), true);

            _InsuranceRepo.UpdateExistingInsurance(6, newInsurance);
            KomodoInsurance UpdateInsurance = _InsuranceRepo.GetKomodoByInsurance(4);

            Assert.AreEqual(UpdateInsurance.ClaimID, newInsurance.ClaimID);
        }
        private void GetInsuranceTest()
        {
            KomodoInsuranceRespository komodoInsurance = new KomodoInsuranceRespository();
            KomodoInsurance            komodo          = new KomodoInsurance(4, KomodoInsurance.ClaimType.Robbery, "The Robber Stole all my soup.", 4, new DateTime(2019, 06, 18), new DateTime(2019, 06, 18), true);

            komodoInsurance.AddInsuranceToList(komodo);
            KomodoInsurance actual = _InsuranceRepo.GetKomodoByInsurance(4);

            Assert.AreEqual(komodo, actual);
        }
Exemplo n.º 3
0
        private void EnterNewClaim()
        {
            //intialize
            KomodoInsurance Insurance = new KomodoInsurance();

            //GetClaim
            Console.Write("Enter new Claim starting at 5: ");
            Insurance.ClaimID = int.Parse(Console.ReadLine());
            Console.Write("Enter the type of claim you wish to add (1 = Car, Home, Robbery): ");
            Insurance.OfClaimType = (KomodoInsurance.ClaimType) int.Parse(Console.ReadLine());
            Console.Write("Describe the incident you were in: ");
            Insurance.Description = Console.ReadLine();
            Console.Write("Write the amount your claim is for: ");
            Insurance.ClaimAmount = int.Parse(Console.ReadLine());
            Console.Write("Write the date of the Incident:\nyyyy, mm, dd: ");
            Insurance.DateOfIncident = DateTime.Parse(Console.ReadLine());
            Console.Write("Write the date of the claim:\nyyyy, mm, dd: ");
            Insurance.DateOfClaim = DateTime.Parse(Console.ReadLine());
            Console.Write("Is this claim valid?\ntrue/false: ");
            Insurance.IsValid = bool.Parse(Console.ReadLine());
            //add to list
            _challengeTwo.AddInsuranceToList(Insurance);
        }