public async Task CopyTags() { var tag = _fixture.Create <Tag>(); var newName = tag.TagName; var mergeInfo = new TagCopyInfo { NewTagName = newName, SourceTagId = 1 }; _photosService.Setup(m => m.CopyTags(mergeInfo.NewTagName, mergeInfo.SourceTagId)) .ReturnsAsync(tag); var response = await _tagsController.CopyTag(mergeInfo); _photosService.Verify(m => m.CopyTags(mergeInfo.NewTagName, mergeInfo.SourceTagId), Times.Once); Assert.IsType <OkObjectResult>(response); var value = ((OkObjectResult)response).Value; Assert.IsType <Dto.Tag>(value); var dto = value as Dto.Tag; Assert.Equal(tag.TagName, dto.TagName); Assert.Equal(tag.TagId, dto.TagId); }