Пример #1
0
        private void NewClaim()
        {
            Console.Clear();
            ClaimClass claimContent = new ClaimClass();

            Console.WriteLine("Claim Creation Page!");

            Console.WriteLine("Please enter a claim ID number.");
            claimContent.ClaimID = int.Parse(Console.ReadLine());

            Console.WriteLine("Please enter the type of claim. Please select a number between 1-3.\n" +
                              "1: Car\n" +
                              "2: Home\n" +
                              "3: Theft");
            string claimType = Console.ReadLine();

            switch (claimType)
            {
            case "1":
                claimContent.ClaimType = ClaimType.Car;
                break;

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

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

            default:
                Console.WriteLine("Please select a number between 1 and 3.");
                Console.ReadKey();
                break;
            }

            Console.WriteLine("Please enter claim description.");
            claimContent.Description = Console.ReadLine();

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

            Console.WriteLine("Please set a date of incident in the format of YYYY/MM/DD.");
            claimContent.DateOfIncident = DateTime.Parse(Console.ReadLine());

            Console.WriteLine("Please set a date of claim in the form of YYYY/MM/DD.");
            claimContent.DateOfClaim = DateTime.Parse(Console.ReadLine());

            _claimsRepo.AddContentToDirectory(claimContent);
        }
Пример #2
0
        public void Arrange()
        {
            _claimsRepo = new ClaimsRepo();

            _claimClass = new ClaimClass();

            _claimsRepo.AddContentToDirectory(_claimClass);
        }
Пример #3
0
        public void AddToDirectory_FingersCrossedBool()
        {
            ClaimClass claimContent = new ClaimClass();
            ClaimsRepo Repo         = new ClaimsRepo();

            bool addResult = Repo.AddContentToDirectory(claimContent);

            Assert.IsTrue(addResult);
        }
Пример #4
0
        public void GetDirectory_Hopefully()
        {
            ClaimClass claimContent = new ClaimClass();

            ClaimsRepo Repoz = new ClaimsRepo();

            Repoz.AddContentToDirectory(claimContent);

            List <ClaimClass> Content = Repoz.GetclaimContent();

            bool directoriesGotclaimContent = Content.Contains(claimContent);

            Assert.IsTrue(directoriesGotclaimContent);
        }