public async Task GetPhotosToTag() { var photoIds = _fixture.CreateMany <int>(5).ToArray(); var tags = _fixture.CreateMany <Tag>(5); _photosService.Setup(m => m.GetTagsAndPhotos(photoIds)) .ReturnsAsync(tags); var response = await _tagsController.GetPhotosToTag(photoIds); _photosService.Verify(m => m.GetTagsAndPhotos(photoIds), Times.Once); Assert.IsType <OkObjectResult>(response); var value = ((OkObjectResult)response).Value; Assert.IsType <BatchSelectTags>(value); var dto = value as BatchSelectTags; Assert.Equal(tags.Count(), dto.Tags.Count); }