Пример #1
0
        //create
        private void EnquiingClaimToQueue()
        {
            Claim content = new Claim();

            Console.WriteLine("Enter Claim ID.");
            content.ID = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Add claim type by the following numbers\n" +
                              "1. Auto \n" +
                              "2. Home \n" +
                              "3. Renters \n" +
                              "4. Property \n");

            string type = Console.ReadLine();

            type = type.Replace(" ", "");
            type = type.Trim();

            switch (type)
            {
            case "1":
                content.TypeOfClaim = ClaimType.Auto;
                break;

            case "2":
                content.TypeOfClaim = ClaimType.Home;
                break;

            case "3":
                content.TypeOfClaim = ClaimType.Renters;
                break;

            case "4":
                content.TypeOfClaim = ClaimType.Property;
                break;
            }

            Console.WriteLine("Describe the incident");
            content.Description = Console.ReadLine();

            Console.WriteLine("How much money is this claim for?");
            content.Ammount = Convert.ToDouble(Console.ReadLine());

            Console.WriteLine("When did the incident happen?\n" +
                              "Please enter date yyyy/mm/dd");
            content.DateOfIncident = Convert.ToDateTime(Console.ReadLine());

            Console.WriteLine("When was the claim submitted?\n" +
                              "Please enter date yyyy/mm/dd");
            content.DateClaimMade = Convert.ToDateTime(Console.ReadLine());

            _repo.EnquingClaimToQueue(content);
            Console.WriteLine("Your item has been added. Press any key to return to the menu.");
            Console.ReadKey();
        }
Пример #2
0
        public void EnquiingClaim_ShouldGetCorrectBoolean()
        {
            Claim          content = new Claim();
            Insurance_Repo repo    = new Insurance_Repo();

            bool addResult = repo.EnquingClaimToQueue(_claim);

            Assert.IsTrue(addResult);
        }
Пример #3
0
        public void GetQueue_ShouldReturnAllQueuedItems()
        {
            Claim          content = new Claim();
            Insurance_Repo repo    = new Insurance_Repo();

            repo.EnquingClaimToQueue(content);

            Queue <Claim> contents = repo.GetAllClaims();

            bool queueHasContent = contents.Contains(content);

            Assert.IsTrue(queueHasContent);
        }
Пример #4
0
 public void Arrange()
 {
     _repo  = new Insurance_Repo();
     _claim = new Claim(1343, ClaimType.Renters, "Apartment above flooded which created water damage for lower resident.", 25000.00, new DateTime(2020, 01, 23), new DateTime(2020, 01, 31));
     _repo.EnquingClaimToQueue(_claim);
 }