public static async Task <ActivityResult <ProducerResult> > ProduceValidateTransferCommandAsync( TransactionItem item, IDurableOrchestrationContext context, ILogger log) { ValidateTransferCommand command = CommandFactory.BuildValidateTransferCommand(item); string functionName = nameof(ProducerActivity.ValidateTransferCommandProducerActivity); return(await RunProducerActivityAsync(functionName, command, context, log)); }
public void Validate_command_should_be_built_with_valid_payload() { var item = new TransactionItem { Id = Guid.NewGuid().ToString(), AccountFromId = Guid.NewGuid().ToString(), AccountToId = Guid.NewGuid().ToString(), Amount = 100.00M, State = SagaState.Pending.ToString() }; ValidateTransferCommand validateTransferCommand = CommandFactory.BuildValidateTransferCommand(item); Assert.NotNull(validateTransferCommand); Assert.Equal(validateTransferCommand.Header.TransactionId, item.Id); Assert.Equal(nameof(ValidateTransferCommand), validateTransferCommand.Header.MessageType); Assert.Equal(nameof(Sources.Orchestrator), validateTransferCommand.Header.Source); }