Ejemplo n.º 1
0
        public void Arrange()
        {
            _repo = new ClaimRepo();
            _data = new ClaimLibrary(1, "Car", "Car Accident on 465", 400.00, new DateTime(18, 04, 25), new DateTime(18 / 04 / 27), true);

            _repo.AddDataToList(_data);
        }
Ejemplo n.º 2
0
        public void Arrange()
        {
            _claimDirectory = new ClaimRepo();
            _claim          = new Claim("1", ClaimType.Car, "Car accident on 465", 400.00, DateTime.Parse("2018-04-25"), DateTime.Parse("2018-04-27"), true);

            _claimDirectory.AddClaimToQueue(_claim);
        }
Ejemplo n.º 3
0
        public void Arrange()
        {
            _repo  = new ClaimRepo();
            _claim = new Claim(1, ClaimType.Car, "Car accident on 465.", 400.00m, new DateTime(2018, 04, 25), new DateTime(2018, 04, 27), true);

            _repo.AddClaimToQueue(_claim);
        }
Ejemplo n.º 4
0
        public void Arrange()
        {
            _claimRepo = new ClaimRepo();
            _claim     = new Claim((ClaimType)3, "Stolen swag", 4.00m, new DateTime(2018, 12, 30), new DateTime(2019, 01, 31));

            _claimRepo.AddClaimToQueue(_claim);
        }
Ejemplo n.º 5
0
 public void TestCleanup()
 {
     _repo      = null;
     claimOne   = null;
     claimTwo   = null;
     claimThree = null;
 }
        public void Arrange()
        {
            _repo  = new ClaimRepo();
            _claim = new Claim(3, TypeOfClaim.Home, "stolen ring", 200.00, DateTime.Parse("12/24/2017"), DateTime.Parse("01/05/2018"));

            _repo.CreateANewClaimToQueue(_claim);
        }
Ejemplo n.º 7
0
        public void UpdateTest()
        {
            //Set test
            Claim newClaim = new Claim();

            newClaim.ClaimId        = "1";
            newClaim.ClaimType      = ClaimType.Car;
            newClaim.Description    = "Accident on I-69";
            newClaim.DateOfIncident = new DateTime(2020, 1, 18);
            newClaim.DateOfClaim    = new DateTime(2020, 1, 30);
            ClaimRepo newClaimRepo = new ClaimRepo();

            //Can you add it ok
            newClaimRepo.AddClaimToLists(newClaim);

            //Update test
            newClaim.Description = "Accident on I-70";
            newClaimRepo.UpdateExistingClaim("1", newClaim);

            //Does description update
            string expected2 = "Accident on I-70";
            string actual2   = newClaim.Description;

            Assert.AreEqual(expected2, actual2);      //Updated without issue
        }
Ejemplo n.º 8
0
 public void Arrange()
 {
     _claimRepo = new ClaimRepo();
     _claim     = new Claim(1, ClaimType.Car, "crash", 400.00m, new DateTime(2020, 12, 15), new DateTime(2020, 12, 16));
     _claimRepo.EnqueueToDatabase(_claim);
     _claimItems = _claimRepo.GetAllClaims();
 }
Ejemplo n.º 9
0
        public void Arrange()
        {
            _claimRepo = new ClaimRepo();
            _claim     = new Claim("TestClaim");

            _claimRepo.AddNewClaim(_claim);
        }
Ejemplo n.º 10
0
        public void TestNextClaim_DesplaysNextClaimInList()
        {
            ClaimRepo repo = new ClaimRepo();

            repo.AddClaim(ID, claimType, description, amount, incident, claim);
            Assert.IsTrue(repo.ShowNextClaim());
        }
Ejemplo n.º 11
0
        public void TestAddClaimAndSeeClaims_AddClaimToListAndDisplay()
        {
            ClaimRepo repo = new ClaimRepo();

            repo.AddClaim(ID, claimType, description, amount, incident, claim);
            Assert.IsTrue(repo.SeeClaims());
        }
Ejemplo n.º 12
0
        public void Arrange()
        {
            _repo    = new ClaimRepo();
            _content = new Claim(4, ClaimType.Theft, "Stole the Crown Jewels", "$1,000,000,000,", new DateTime(2020, 7, 28), new DateTime(2020, 8, 30), false);

            _repo.AddClaimToQueue(_content);
        }
        public void Test_SeeAllClaims()
        {
            var claimrepo = new ClaimRepo();

            claimrepo.SeeAllClaims();
            Assert.IsNotNull(_claims);
        }
Ejemplo n.º 14
0
        public void DefaultValues()
        {
            _repo    = new ClaimRepo();
            _content = new ClaimContent(1, TypesOfClaims.Car, "Crash", 4999, new DateTime(2020, 12, 9), new DateTime(2020, 12, 10), true);

            _repo.AddClaim(_content);
        }
Ejemplo n.º 15
0
 public void Arrange()
 {
     _ClaimQueue = new ClaimRepo();
     Queue <Claim1> Claims = new Queue <Claim1>
     {
     }
 }
        public void AddClaimAddsClaim()
        {
            Claim     claim     = new Claim();
            ClaimRepo claimRepo = new ClaimRepo();
            bool      result    = claimRepo.AddClaim(claim);

            Assert.IsTrue(result);
        }
Ejemplo n.º 17
0
 public void Arrange()
 {
     _repo  = new ClaimRepo();
     _claim = new Claim(1, TypeOfClaim.Car,
                        "Car accident on 465", 400.00m,
                        "04/25/2018", "04/27/2018", true);
     _repo.AddAClaimToQueue(_claim);
 }
Ejemplo n.º 18
0
        public void TestRemoveClaim_RemovesTheFirstClaimInList()
        {
            ClaimRepo repo = new ClaimRepo();

            repo.AddClaim(ID, claimType, description, amount, incident, claim);
            repo.RemoveClaim();
            Assert.IsFalse(repo.SeeClaims());
        }
        public void Test_WorkNextClaim()
        {
            var claimrepo     = new ClaimRepo();
            var initialclaims = _claims.Count;

            claimrepo.WorkNextClaim();
            Assert.AreNotEqual(initialclaims, _claims.Count);
        }
Ejemplo n.º 20
0
        public void NewClaimTestMethod()
        {
            //Arrenge
            ClaimRepo repo   = new ClaimRepo();
            Claim     toTest = new Claim(ClaimOptions.Car, "the car hit the block", 277.67, new DateTime(2020, 3, 15), new DateTime(2020, 3, 16), true);

            //Act -
            repo.AddClaimToDirectory(toTest);
        }
Ejemplo n.º 21
0
        public void ClaimsTestsArrange()
        {
            _claimQueue = new ClaimRepo();
            var claim1 = new Claim(TypeOfClaim.Car, "Car accident on 465.", 400.00, new DateTime(2018, 4, 25), new DateTime(2018, 4, 27));
            var claim2 = new Claim(TypeOfClaim.Home, "House fire in kitchen.", 4000.00, new DateTime(2018, 4, 11), new DateTime(2018, 4, 12));

            _claimQueue.AddClaimToQueue(claim1);
            _claimQueue.AddClaimToQueue(claim2);
        }
Ejemplo n.º 22
0
        public void CreateANewClaim()
        {
            Claim1    claims     = new Claim1();
            ClaimRepo repository = new ClaimRepo();

            bool addResult = repository.ClaimIsValid(claims);

            Assert.IsTrue(addResult);
        }
Ejemplo n.º 23
0
        public void AddClaimToQueue_ShouldGetCorrectBoolean()
        {
            Claims    claim      = new Claims();
            ClaimRepo repository = new ClaimRepo();

            bool addClaim = repository.AddClaimToQueue(claim);

            Assert.IsTrue(addClaim);
        }
Ejemplo n.º 24
0
        public void AddClaim()
        {
            ClaimProp claim         = new ClaimProp();
            ClaimRepo repoDirectory = new ClaimRepo();

            bool addResult = repoDirectory.AddClaimToDirectory(claim);

            Assert.IsTrue(addResult);
        }
Ejemplo n.º 25
0
        public void DisplayNextWhenVoidTests()
        {
            ClaimRepo repo = new ClaimRepo();

            Assert.AreEqual(0, repo._claimRepo.Count);
            bool result = repo.DisplayNextClaim();

            Assert.IsFalse(result);
        }
Ejemplo n.º 26
0
        public void AddClaim_ShouldGetNotNull()
        {
            Claim     test     = new Claim();
            ClaimRepo testRepo = new ClaimRepo();

            testRepo.AddClaim(test);
            Claim fromRepo = testRepo.GetQueue().Peek();

            Assert.IsNotNull(fromRepo);
        }
Ejemplo n.º 27
0
        public void AddItemForTest()
        {
            List <string> ingred = new List <string> {
                "Green", "Red", "Yellow"
            };

            _repo    = new ClaimRepo();
            _content = new ClaimProp(12342, ClaimType.Car, "Missing Steering Wheel", "$400", Convert.ToDateTime("5/12/19"), Convert.ToDateTime("5/22/19"));
            _repo.AddClaimToDirectory(_content);
        }
        public void HandleClaimRemovesClaimFromDB()
        {
            Claim     claim     = new Claim();
            ClaimRepo claimRepo = new ClaimRepo();

            claimRepo.AddClaim(claim);
            bool isHandled = claimRepo.HandleClaim(claim);

            Assert.IsTrue(isHandled);
        }
Ejemplo n.º 29
0
 public void TestInit()
 {
     _repo      = new ClaimRepo();
     claimOne   = new Claim(1, ClaimType.Car, "Hit a horse and exploded", 25000.11234, new DateTime(2011, 11, 21), new DateTime(2020, 3, 19));
     claimTwo   = new Claim(2, ClaimType.Home, "Horse exploded and blew out my windows", 350.285678, new DateTime(2011, 11, 21), new DateTime(2011, 11, 30));
     claimThree = new Claim(3, ClaimType.Theft, "Someone stole my horse and car for nefarious reasons", 20000.37466, new DateTime(2011, 10, 30), new DateTime(2011, 11, 21));
     _repo.CreateNewClaim(claimOne);
     _repo.CreateNewClaim(claimTwo);
     _repo.CreateNewClaim(claimThree);
 }
Ejemplo n.º 30
0
        public ClaimEntity UpdateStatus(ClaimEntity claim, StatusEntity status)
        {
            claim.Status           = status;
            claim.StatusId         = status.Id;
            claim.StatusName       = status.Name;
            claim.WhenLastModified = DateTime.Now;

            ClaimRepo.Update(claim);

            return(claim);
        }