Exemplo n.º 1
0
        public void IsValidCalculation()
        {
            //Arrange -> Set things up.
            DateTime dA = new DateTime(2020, 05, 12);
            DateTime dB = new DateTime(2020, 05, 14);
            //Act - Do some work
            bool isSuccessful = _kCRepo.IsValidCalculaiton(dA, dB);

            Console.WriteLine(isSuccessful);
            //Assert check to see if the work is working
            Assert.IsTrue(isSuccessful);
        }
Exemplo n.º 2
0
        private void EnterANewClaim()
        {
            Console.Clear();
            Claims claims = new Claims();

            Console.WriteLine("Please input a new claim Id");
            int newclaimId = int.Parse(Console.ReadLine());

            claims.ClaimAmount = newclaimId;

            Console.WriteLine("Please enter the claim type\n" +
                              "1. Car\n" +
                              "2. Home\n" +
                              "3. Theft\n");
            int       inputClaimType = int.Parse(Console.ReadLine());
            ClaimType claimType      = (ClaimType)inputClaimType;

            switch (claimType)
            {
            case ClaimType.Car:
                claims.ClaimType = ClaimType.Car;
                break;

            case ClaimType.Home:
                claims.ClaimType = ClaimType.Home;
                break;

            case ClaimType.Theft:
                claims.ClaimType = ClaimType.Theft;
                break;

            default:
                Console.WriteLine("invalid Choice");
                break;
            }

            Console.WriteLine("Pleae enter a description");
            string inputdescription = Console.ReadLine();

            claims.Description = inputdescription;

            Console.WriteLine("Please enter the claim amount");
            double inputClaimAmount = double.Parse(Console.ReadLine());

            claims.ClaimAmount = inputClaimAmount;

            claims.DateOfIncident = GetDateTime("Date Of Incident");
            claims.DateOfClaim    = GetDateTime("Date Of Claim");

            claims.IsValid = _komodoClaimsRePo.IsValidCalculaiton(claims.DateOfIncident, claims.DateOfClaim);

            if (claims.IsValid)
            {
                Console.WriteLine("Claim is valid");
            }
            else
            {
                Console.WriteLine("Claim is not valid");
            }

            _komodoClaimsRePo.AddClaimToQueue(claims);
        }