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); }
public void Clean() { var tagRepository = new TsqlTagRepository(_connectionString); foreach (var id in createdTagIDs) { tagRepository.DeleteEntity(id); } }
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); } }