Ejemplo n.º 1
0
        private void SeeAllClaims()
        {
            Console.Clear();
            Queue <ClaimContents> _listOfClaimsQ = _claimContentRepo.GetListOfClaims();

            Console.WriteLine("ClaimID  " + "Type   " + "   Description    " + "        Amount     " + "    DateOfAccident     " + "    DateOfClaim    " + "    IsValid    ");
            foreach (ClaimContents claim in _listOfClaimsQ)
            {
                Console.WriteLine($"    {claim.ClaimID}    {claim.TypeOfClaim}      {claim.ClaimDescription}     {claim.ClaimAmount}      {claim.DateOfIncident}      {claim.DateOfClaim}         {claim.IsValid}");
            }
        }
        public void GetClaimList_NotBeNull()
        {
            ClaimContentRepo cRepo  = new ClaimContentRepo();
            ClaimContents    cClaim = new ClaimContents();

            Queue <ClaimContents> listOfClaimsQ = cRepo.GetListOfClaims();

            Assert.IsNotNull(listOfClaimsQ);
        }
        public void AddToClaimQ_ShouldGetNotNull()
        {
            ClaimContentRepo cRepo  = new ClaimContentRepo();
            ClaimContents    cClaim = new ClaimContents(7, ClaimType.Car, "Car accident on 37.", 100.00, new DateTime(2018, 06, 20), new DateTime(2018, 6, 28), true);

            cRepo.AddClaimToQue(cClaim);

            Queue <ClaimContents> listOfClaimsQ = cRepo.GetListOfClaims();

            bool claimNumEq = false;

            foreach (ClaimContents claims in listOfClaimsQ)
            {
                if (claims.ClaimID == cClaim.ClaimID)
                {
                    claimNumEq = true;
                    break;
                }
            }
            Assert.IsTrue(claimNumEq);
        }