コード例 #1
0
        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());
        }
コード例 #2
0
        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());
        }