Esempio n. 1
0
        public void Arrange()
        {
            _claimRepo = new ClaimContentRepository();
            _content   = _claimRepo.GetClaimContentQueue();

            ClaimContent claim      = new ClaimContent(ClaimType.Car, 3, "Car Wreck on I70W", 1500m, DateTime.Parse("2019, 02, 23"), DateTime.Parse("2019, 02, 24"));
            ClaimContent claimTwo   = new ClaimContent(ClaimType.Home, 4, "Home Invasion", 700m, DateTime.Parse("2019, 03, 11"), DateTime.Parse("2019, 03, 12"));
            ClaimContent claimThree = new ClaimContent(ClaimType.Theft, 5, "Tire Thief", 100m, DateTime.Parse("2019, 05, 10"), DateTime.Parse("2019, 05, 25"));

            _claimRepo.AddContentToQueue(claim);
            _claimRepo.AddContentToQueue(claimTwo);
            _claimRepo.AddContentToQueue(claimThree);
        }
Esempio n. 2
0
        private void CreateNewContent()
        {
            ClaimContent newContent = new ClaimContent();

            Console.WriteLine("enter the claim you would like to open");
            string claimNumberAsString = Console.ReadLine();

            newContent.ClaimId = int.Parse(claimNumberAsString);

            Console.WriteLine("Enter the claim type (Vehicle)");
            newContent.ClaimType = Console.ReadLine();

            Console.WriteLine("Enter what happened.");
            newContent.Description = Console.ReadLine();

            Console.WriteLine("what was the date of this incident (yyyy/mm/dd)");
            string dateOfIncidentAsString = Console.ReadLine();

            newContent.DateOfIncident = DateTime.Parse(dateOfIncidentAsString);

            Console.WriteLine("What was the date of the claim (yyyy/mm/dd)");
            string dateOfClaimAsString = Console.ReadLine();

            newContent.DateOfClaim = DateTime.Parse(dateOfClaimAsString);

            Console.WriteLine("How much does the claim cost");
            string claimAmountAsString = Console.ReadLine();

            newContent.ClaimAmount = double.Parse(claimAmountAsString);

            Console.WriteLine("Is this claim valid");
            string validAsString = Console.ReadLine().ToLower();

            if (validAsString == "y")
            {
                newContent.Valid = true;
            }
            else if (validAsString == "n")
            {
                newContent.Valid = false;
            }
            else
            {
                Console.WriteLine("type y/n...");
            }

            _contentRepo.AddContentToQueue(newContent);
        }
Esempio n. 3
0
        public void Arrange()
        {
            _repo    = new ClaimContentRepository();
            _content = new ClaimContent(7, "car", "fender bender", new DateTime(1997 / 5 / 30), new DateTime(1997 / 6 / 10), 560.56, true);

            _repo.AddContentToQueue(_content);
        }
Esempio n. 4
0
        private void EnterANewClaim()
        {
            Console.WriteLine("Please enter a Claim ID");
            string claimIDAsString = Console.ReadLine();
            int    claimID         = int.Parse(claimIDAsString);

            Console.WriteLine("Please select a Claim Type\n" +

                              "1 Car\n" +
                              "2 Home\n" +
                              "3 Theft\n" +
                              "4 Exit");
            string input = Console.ReadLine();

            ClaimType typeofclaim = (ClaimType)int.Parse(input);

            Console.WriteLine("Please enter a description of this claim");
            string description = Console.ReadLine();

            Console.WriteLine("Please enter a claim amount");
            string  claimAmountAsString = Console.ReadLine();
            decimal claimAmount         = decimal.Parse(claimAmountAsString);

            Console.WriteLine("Please enter the date of the incident(yyyy/mm/dd");

            DateTime dateOfIncident = DateTime.Parse(Console.ReadLine());

            Console.WriteLine("Please enter the date of the claim (yyyy/mm/dd");
            DateTime dateOfClaim = DateTime.Parse(Console.ReadLine());

            ClaimContent newClaimContent = new ClaimContent(typeofclaim, claimID, description, claimAmount, dateOfIncident, dateOfClaim);

            _queueRepo.AddContentToQueue(newClaimContent);
        }
Esempio n. 5
0
        public void AddToQueue_ShouldNotGetNull()
        {
            ClaimContent content = new ClaimContent();

            content.ClaimId = 7;
            ClaimContentRepository repository = new ClaimContentRepository();

            repository.AddContentToQueue(content);
            ClaimContent contentFromDirectory = repository.GetContentByNumber(7);

            Assert.IsNotNull(contentFromDirectory);
        }