public SagaTest(DatabaseFixture fixture) { Context = fixture.DatabaseContext; Factory = new StubProviderApiFactory { OnPayment = dto => dto.Token.Equals(FailedToken) ? throw new Exception() : new OkObjectResult("OK"), OnRollback = dto => new OkObjectResult("OK") }; Saga = new MovementSaga { Factory = Factory, Context = Context }; }
public PaymentController(AppDbContext context, IConfiguration configuration, ProviderApiFactory providerApiFactory, ClaimExtractorFactory extractorFactory) : base(extractorFactory) { Context = context; Config = configuration; AmountOfRetries = int.Parse(Config["PaymentRetryAmount"]); ProviderApiFactory = providerApiFactory; Saga = new MovementSaga { Factory = providerApiFactory, Context = context, ResponseEndpoint = Config["ResponseEndpoint"] }; TransactionBuilder = new TransactionBuilder(context); }