public void Add_ShouldThrowArgumentNullExceptionWhenNullTagProvided() { var data = new FakeGalleryData(); var tagsService = new TagsService(data); tagsService.Add(null); }
public void Delete_ShouldReturnProperValueWhenTagIdDoesNotExist() { var data = new FakeGalleryData(); var tagsService = new TagsService(data); var deletedTagId = tagsService.DeleteTagById(GlobalConstants.DefaultTagIdForTesting); Assert.AreEqual(-1, deletedTagId); }
public void GetById_ShouldReturnProperAmountOfTags() { var data = new FakeGalleryData(); var tagsService = new TagsService(data); var newTag = new Tag(); var tagId = newTag.Id; tagsService.Add(newTag); var foundTags = tagsService.GetById(tagId); Assert.AreEqual(1, foundTags.Count()); }
public void Delete_ShouldReturnProperDeletedTagId() { var data = new FakeGalleryData(); var tagsService = new TagsService(data); var newTag = new Tag(); var tagId = newTag.Id; tagsService.Add(newTag); tagsService.DeleteTagById(tagId); var foundTags = tagsService.GetById(tagId); Assert.AreEqual(0, foundTags.Count()); }
public void GetById_ShouldReturnZeroWhenSuchTagIdIsNotFound() { var data = new FakeGalleryData(); var tagsService = new TagsService(data); var foundTags = tagsService.GetById(GlobalConstants.DefaultTagIdForTesting); Assert.AreEqual(0, foundTags.Count()); }