public async Task AddPhotoComment_PopulatesInputProperly() { UserId userId = new Guid("13999be1-095a-4726-87e9-d11f2103585c"); PhotoId photoId = new Guid("d3f31301-c244-4104-9b83-2ad073a8d2d0"); string userName = "******"; string text = "not empty"; PhotoComment observedPhotoComment = null; // set up expectation that AddPhotoComment is invoked in the data repository commentRepositoryMock .Setup(x => x.AddPhotoComment(It.IsAny <PhotoComment>())) .Callback <PhotoComment>(x => observedPhotoComment = x) .Returns(Task.CompletedTask); var service = GetFeedbackService(); await service.AddPhotoComment(photoId, userId, userName, text); observedPhotoComment.ShouldNotBeNull(); observedPhotoComment.PhotoId.ShouldBe(photoId); observedPhotoComment.UserId.ShouldBe(userId); observedPhotoComment.UserName.ShouldBe(userName); observedPhotoComment.Text.ShouldBe(text); }