Ejemplo n.º 1
0
        //Add new Claim()
        private void AddNewClaim()
        {
            //    ClaimID: 1
            Console.WriteLine("What is the Claim ID number?");
            int claimID = int.Parse(Console.ReadLine());

            //Type: Car
            Console.WriteLine("What is type of the insured product (car, house, etc)?");
            string claimType = Console.ReadLine();

            //Description: Car Accident on 464.
            Console.WriteLine("Describe the incident");
            string description = Console.ReadLine();

            //Amount: $400.00
            Console.WriteLine("What is the claim amount?");
            decimal claimAmount = decimal.Parse(Console.ReadLine());

            //DateOfAccident: 4 / 25 / 18
            Console.WriteLine("What is the date of the accident in mm/dd/yyyy?");
            DateTime dateOfIncident = DateTime.Parse(Console.ReadLine());

            //DateOfClaim: 4 / 27 / 18
            Console.WriteLine("What is the date of the claim in the format mm/dd/yyyy?");
            DateTime dateOfClaim = DateTime.Parse(Console.ReadLine());

            TimeSpan diff = dateOfClaim - dateOfIncident;

            bool isValid;

            if (diff.Days > 31)
            {
                isValid = false;
            }
            else
            {
                isValid = true;
            }

            Console.WriteLine(isValid);

            //Console.ReadLine();

            //ClaimQueueRepository claimRepo = new ClaimQueueRepository();

            Claim content = new Claim(claimID, claimType, description, claimAmount, dateOfIncident, dateOfClaim, isValid);

            _claimRepo.AddToQueue(content);
        }
Ejemplo n.º 2
0
        public void ClaimContent_GetQueueCount_ShouldReturnCorrectInt()
        {
            //arrange
            ClaimQueueRepository claimRepo = new ClaimQueueRepository();
              Claim content = new Claim(1, "House", "Fire", 400.00m, new DateTime(2019, 4, 15), new DateTime(2019, 4, 22), true);

            //Act
            claimRepo.AddToQueue(content);
           
              //expect //actual
              var expected = 1;
              var actual = claimRepo.GetQueueContentsCount();

              //Assert
              Assert.AreEqual(expected, actual);

          }
Ejemplo n.º 3
0
        public void ClaimQueue_AddToQueue_ShouldSeeContentOnQueue()
        {
            // Arrange
            ClaimQueueRepository claimRepo = new ClaimQueueRepository();

            Claim content = new Claim(1, "House", "Fire", 400.00m, new DateTime(2019, 4, 15), new DateTime(2019, 4, 22), true);

            // Act
            claimRepo.AddToQueue(content);
            Claim claimContent = claimRepo.PeekNextContent();


            //expect //actual
           // int actual = list.Count;
           // int expected = 1;

            //Assert
            Assert.AreSame(content, claimContent);

            ///left off here.
        }