Esempio n. 1
0
        //CRUD - Create Read Update Delete
        //Create the claim
        public bool AddClaimToDirectory(KClaim content)
        {
            int startingCount = _claimDirectory.Count;

            _claimDirectory.Add(content);
            bool wasAdded = (_claimDirectory.Count > startingCount) ? true : false;

            return(wasAdded);
        }
        public void AddToDirectory_ShouldGetCorrectBoolean()
        {
            //Arrange
            KClaim          claim      = new KClaim();
            ClaimRepository repository = new ClaimRepository();
            //Act
            bool addResult = repository.AddClaimToDirectory(claim);

            //Assert
            Assert.IsTrue(addResult);
        }
        public void GetClaim_ShouldReturnCorrectCollection()
        {
            //Arrange
            KClaim          newObject = new KClaim();
            ClaimRepository repo      = new ClaimRepository();

            repo.AddClaimToDirectory(newObject);
            //Act
            List <KClaim> listOfClaims = repo.GetClaims();
            //Assert
            bool directoryHasClaims = listOfClaims.Contains(newObject);

            Assert.IsTrue(directoryHasClaims);
        }