Ejemplo n.º 1
0
        public void Arrange()
        {
            _repo  = new KomodoClaimsRepo();
            _claim = new KomodoClaims(ClaimType.Car, "Car on fire.", "$400.00", new DateTime(2020, 4, 01), new DateTime(2020, 4, 02), true);

            _repo.AddClaimToQueue(_claim);
        }
        public void Arrange()
        {
            _repo = new KomodoClaimsRepo();

            _content = new ClaimsPOCOs(1, "Car Accident on 465", 400, ClaimType.Car, DateTime.Parse("4/25/18"), DateTime.Parse("4/27/18"));

            _repo.AddClaimToQueue(_content);
        }
        public void AddClaimToQueue()
        {
            ClaimsPOCOs      content    = new ClaimsPOCOs();
            KomodoClaimsRepo repository = new KomodoClaimsRepo();

            bool addResult = repository.AddClaimToQueue(content);

            Assert.IsTrue(addResult);
        }
        // Enter a new claim
        private void CreateNewClaim()
        {
            Console.Clear();
            KomodoClaims newClaim = new KomodoClaims();

            Console.WriteLine("Enter the number for the claim type:\n" +
                              "1. Car\n" +
                              "2. Home\n" +
                              "3. Theft");
            int claimAsInt = int.Parse(Console.ReadLine());

            newClaim.TypeOfClaim = (ClaimType)claimAsInt;

            Console.WriteLine("Enter the claim description:");
            newClaim.Description = Console.ReadLine();

            Console.WriteLine("Enter the claim amount ($1,000, $650, $125):");
            newClaim.ClaimAmount = Console.ReadLine();


            var IncidentDate = GetDateTime("Incident Data");

            newClaim.DateOfIncident = IncidentDate;


            var claimDate = GetDateTime("Claim Data");

            newClaim.DateOfClaim = claimDate;

            newClaim.IsValid = _claimsRepo.CalculateIsValid(newClaim.DateOfIncident, newClaim.DateOfClaim);

            if (newClaim.IsValid)
            {
                Console.WriteLine("Valid Cliam");
            }
            else
            {
                Console.WriteLine("InValid Calim");
            }

            _claimsRepo.AddClaimToQueue(newClaim);
        }
Ejemplo n.º 5
0
        public void AddToList_ShouldGetNotNull()
        {
            // Arrange
            KomodoClaims claim = new KomodoClaims();

            claim.ClaimID = int.Parse("01");
            KomodoClaimsRepo repo = new KomodoClaimsRepo();

            // Act
            repo.AddClaimToQueue(claim);
            KomodoClaims claimFromQueue = repo.GetClaimByID(01);

            // Assert
            Assert.IsNotNull(claimFromQueue);
        }
Ejemplo n.º 6
0
        private void AddClaimToQueue()
        {
            Console.Clear();

            ClaimsPOCOs claim = new ClaimsPOCOs();

            Console.WriteLine("What is the claim ID");
            int userInputClaimID = int.Parse(Console.ReadLine());

            claim.ClaimID = userInputClaimID;

            Console.WriteLine("What is the Description of the Claim?");
            string userInputClaimDescription = Console.ReadLine();

            claim.Description = userInputClaimDescription;

            Console.WriteLine("Enter the Claim Amount");
            int userInputClaimAmount = int.Parse(Console.ReadLine());

            claim.ClaimAmount = userInputClaimAmount;

            Console.WriteLine("Enter the Claim Type.\n" +
                              "1. Car \n" +
                              "2. Home\n" +
                              "3. Theft");
            string userInputClaimType = Console.ReadLine();

            switch (userInputClaimType)
            {
            case "1":
                claim.ClaimType = ClaimType.Car;
                break;

            case "2":
                claim.ClaimType = ClaimType.Home;
                break;

            case "3":
                claim.ClaimType = ClaimType.Theft;
                break;

            default:
                break;
            }



            Console.WriteLine("Enter the Date of the Incident\n" +
                              "Format is YYYY/MM/DD");
            DateTime userInputDateOfIncident = DateTime.Parse(Console.ReadLine());

            claim.DateOfIncident = userInputDateOfIncident;

            Console.WriteLine("Date of Claim\n" +
                              "Format is YYYY/MM/DD");
            DateTime userInputDateOfClaim = DateTime.Parse(Console.ReadLine());

            claim.DateOfClaim = userInputDateOfClaim;


            _claimRepo.AddClaimToQueue(claim);

            Console.ReadKey();
        }