public static async Task <ActivityResult <ProducerResult> > ProduceIssueReceiptCommandAsync( TransactionItem item, IDurableOrchestrationContext context, ILogger log) { IssueReceiptCommand command = CommandFactory.BuildIssueReceiptCommand(item); string functionName = nameof(ProducerActivity.ReceiptCommandProducerActivity); return(await RunProducerActivityAsync(functionName, command, context, log)); }
public void Receipt_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() }; IssueReceiptCommand issueReceiptCommand = CommandFactory.BuildIssueReceiptCommand(item); Assert.NotNull(issueReceiptCommand); Assert.Equal(issueReceiptCommand.Header.TransactionId, item.Id); Assert.Equal(nameof(IssueReceiptCommand), issueReceiptCommand.Header.MessageType); Assert.Equal(nameof(Sources.Orchestrator), issueReceiptCommand.Header.Source); }