Пример #1
0
        private void EnterAClaim()
        {
            Console.Clear();
            Claims newContent = new Claims();

            Console.WriteLine("What ID number would you like to use for this claim?");
            newContent.ClaimID = Int32.Parse(Console.ReadLine());

            Console.WriteLine("Enter the number for Claim Type?\n " +
                              " 1. Car\n " +
                              " 2. Home\n " +
                              " 3. Theft \n " +
                              " 4. Boat");
            newContent.ClaimType = (ClaimType)int.Parse(Console.ReadLine());

            Console.WriteLine("Give a brief description of this claim:");
            newContent.Description = Console.ReadLine();

            Console.WriteLine("What is the amount of the claim?");
            newContent.ClaimAmount = Double.Parse(Console.ReadLine());

            Console.WriteLine("What is the date of incident? eg. yyyy/mm/dd");
            newContent.DateOfIncident = Convert.ToDateTime(Console.ReadLine());

            Console.WriteLine("What is the date of the claim? eg. yyyy/mm/dd");
            newContent.DateOfClaim = Convert.ToDateTime(Console.ReadLine());

            _claimsInfo.AddClaim(newContent);
        }
        public void Arrange()
        {
            DateTime inDateTime    = new DateTime(2020, 07, 10);
            DateTime claimDateTime = new DateTime(2020, 07, 15);

            _repo    = new ClaimsRepository();
            _content = new Claim(10, ClaimType.Car, "Fender Bender", 500.00, inDateTime, claimDateTime);
            _repo.AddClaim(_content);
            _content = new Claim(20, ClaimType.Car, "Accident", 1500.00, inDateTime, claimDateTime);
            _repo.AddClaim(_content);
        }
Пример #3
0
        public void AddClaim_ShouldReturnTrue()
        {
            Claim newClaim = new Claim();

            bool added = _claimsRepository.AddClaim(newClaim);

            Assert.IsTrue(added);
        }
Пример #4
0
        public void AddToMenu_ShouldGetCorrectBoolean()
        {
            Claim            content    = new Claim();
            ClaimsRepository repository = new ClaimsRepository();

            bool addResult = repository.AddClaim(content);

            Assert.IsTrue(addResult);
        }
Пример #5
0
        public void AddClaim()
        {
            Claim carCrash = new Claim(1, ClaimTypes.Car, "Minor Fender Bender", 1.99m, new DateTime(2018, 04, 25), new DateTime(2018, 04, 27));

            _repo.AddClaim(carCrash);
            Queue <Claim> claims = _repo.GetClaims();

            bool menuHasCarCrash = claims.Contains(carCrash);

            Assert.IsTrue(menuHasCarCrash);
        }
        public void AddClaim_ShouldGetCorrectBoolean()
        {
            //Arrange
            Claim            content = new Claim();
            ClaimsRepository _repo   = new ClaimsRepository();
            //Act
            bool addResult = _repo.AddClaim(content);

            // Assert
            Assert.IsTrue(addResult);
        }
Пример #7
0
        private void AddNewClaim()
        {
            Claim newClaim = new Claim();

            PrintBanner();

            _console.WriteLine("Add New Claim\n");

            SetClaimId(ref newClaim);
            SetClaimType(ref newClaim);
            SetClaimDescription(ref newClaim);
            SetClaimAmount(ref newClaim);
            SetDateOfIncident(ref newClaim);
            SetDateOfClaim(ref newClaim);
            SetClaimValidStatus(ref newClaim);

            if (_claimsRepository.AddClaim(newClaim))
            {
                _console.WriteLine("\nClaim Added Successfully!.");
            }
            else
            {
                _console.WriteLine("\nCould not Add New Claim.\nPlease try agaon later.\n");
            }

            ReturnOrQuit();
        }
        public void GetContents_ShouldReturnCorrectCollection()
        {
            //Arrange
            Claim            content = new Claim();
            ClaimsRepository repo    = new ClaimsRepository();

            repo.AddClaim(content);
            //Act
            Queue <Claim> contents        = _repo.GetContents();
            bool          queueHasContent = contents.Contains(content);

            //Assert
            Assert.IsTrue(queueHasContent);
        }
        public void TestCreateMethod()
        {
            //Arrange
            Claims content = new Claims();

            content.ClaimID = (1);
            ClaimsRepository claimsRepository = new ClaimsRepository();

            //Act
            claimsRepository.AddClaim(content);
            Claims claims = claimsRepository.GetClaimByNumber(1);

            //Assert
            Assert.IsNotNull(claims);
        }
Пример #10
0
        public void Arrange()
        {
            _claimsRepository = new ClaimsRepository();

            uniqueNewClaim = new Claim()
            {
                ClaimAmount    = 40000m,
                ClaimID        = 1,
                TypeOfClaim    = ClaimType.Car,
                Description    = "Collision on Hudson avenue",
                DateOfClaim    = DateTime.Now,
                DateOfIncident = new DateTime(2020, 9, 11)
            };

            _claimsRepository.AddClaim(uniqueNewClaim);
        }
 public void Arrange()
 {
     _claimsRepo = new ClaimsRepository();
     _claims     = new Claims(1, ClaimType.Car, "Car Accident on 465", 400, new DateTime(2018, 4, 25), new DateTime(2018, 4, 27), true);
     _claimsRepo.AddClaim(_claims);
 }