Beispiel #1
0
        public void DeleteTag_UnknownIdPassed_ReturnsNotFound()
        {
            _mockRepository.Setup(r => r.GetTagById(It.IsAny <long>())).Returns((Tag)null);

            var notFoundResult = _controller.DeleteTag(5);

            Assert.IsType <NotFoundResult>(notFoundResult);
        }
        public async Task DeleteTag()
        {
            var tagId = _fixture.Create <int>();

            _photosService.Setup(m => m.DeleteTag(tagId));

            var response = await _tagsController.DeleteTag(tagId);

            _photosService.Verify(m => m.DeleteTag(tagId),
                                  Times.Once);

            Assert.IsType <OkResult>(response);
        }