public async Task Handle_Success() { // Arrange GetEditUserProfileOutput recordedOutput = null; A.CallTo(() => outputPort.Output(A <GetEditUserProfileOutput> ._)) .Invokes(call => recordedOutput = (GetEditUserProfileOutput)call.Arguments[0]); // Act var result = await interactor.Handle(CreateRequest(DiverFactory.JohnDoeDiverId), CancellationToken.None); // Assert result.IsSuccessful.Should().BeTrue(); A.CallTo(() => outputPort.Output(A <GetEditUserProfileOutput> ._)) .MustHaveHappenedOnceExactly(); Approvals.VerifyJson(JsonConvert.SerializeObject(recordedOutput)); }
public void Output([NotNull] GetEditUserProfileOutput interactorOutput) { if (interactorOutput == null) { throw new ArgumentNullException(nameof(interactorOutput)); } viewModel = new MvcEditUserProfileViewModel( interactorOutput.UserId, interactorOutput.Username, interactorOutput.Fullname, interactorOutput.Firstname, interactorOutput.Lastname, interactorOutput.Slogan, interactorOutput.Education, interactorOutput.Experience, interactorOutput.MobilePhone, interactorOutput.WebsiteUrl, interactorOutput.TwitterHandle, interactorOutput.FacebookId, interactorOutput.SkypeId); }