public async Task PutCreatorInformation(string userId, [FromBody] CreatorInformation creatorInformation) { userId.AssertUrlParameterProvided("userId"); creatorInformation.AssertBodyProvided("creatorInformation"); var requester = await this.requesterContext.GetRequesterAsync(); var requestedUserId = new UserId(userId.DecodeGuid()); var command = new UpdateCreatorAccountSettingsCommand(requester, requestedUserId); await this.updateCreatorAccountSettings.HandleAsync(command); }
public async Task WhenPutCreatorInformationIsCalled_ItShouldCallTheCommandHandler() { var command = new UpdateCreatorAccountSettingsCommand(Requester, RequestedUserId); this.promoteUserToCreator.Setup(v => v.HandleAsync(command)) .Returns(Task.FromResult(0)) .Verifiable(); var updatedAccountSettings = new CreatorInformation(); await this.target.PutCreatorInformation(RequestedUserId.Value.EncodeGuid(), updatedAccountSettings); this.updateAccountSettings.Verify(); }