Exemple #1
0
        public void DeleteEntity_RemoveTag()
        {
            // arrange
            var tagRepository = new TsqlTagRepository(_connectionString);
            var testedTag     = new Tag()
            {
                TagID   = -1,
                TagName = "deleteTestTag"
            };

            testedTag = tagRepository.CreateEntity(testedTag);
            bool flag;

            // act
            try
            {
                tagRepository.DeleteEntity(testedTag.TagID);
                flag = true;
            }
            catch (Exception)
            {
                flag = false;
            }

            // assert
            Assert.IsTrue(flag);
        }
Exemple #2
0
        public void Clean()
        {
            var tagRepository = new TsqlTagRepository(_connectionString);

            foreach (var id in createdTagIDs)
            {
                tagRepository.DeleteEntity(id);
            }
        }
Exemple #3
0
        public void Clean()
        {
            var tagRepository  = new TsqlTagRepository(_connectionString);
            var userRepository = new TsqlUserRepository(_connectionString);
            var noteRepository = new TsqlNoteRepository(_connectionString, userRepository, tagRepository);

            foreach (var id in createdNoteIDs)
            {
                noteRepository.DeleteEntity(id);
            }

            foreach (var id in createdTagIDs)
            {
                tagRepository.DeleteEntity(id);
            }

            foreach (var id in createdUserIDs)
            {
                userRepository.DeleteEntity(id);
            }
        }