static async Task ImportIntoCosmosDB(HighContentionScenario scenarioContext)
        {
            var container = SetupFixture.Container;

            var actualSagaId = CosmosSagaIdGenerator.Generate(typeof(HighContentionEndpointWithMigrationMode.HighContentionSaga),
                                                              nameof(HighContentionEndpointWithMigrationMode.HighContentionSaga.HighContentionSagaData.SomeId), scenarioContext.SomeId);

            string document = string.Format(MigrationDocument, scenarioContext.MigratedSagaId, actualSagaId, scenarioContext.SomeId);

            using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(document)))
            {
                var response = await container.CreateItemStreamAsync(stream, new PartitionKey(actualSagaId.ToString()));

                Assert.IsTrue(response.IsSuccessStatusCode, "Successfully imported");
            }
        }
Example #2
0
 public HighContentionSaga(HighContentionScenario scenario) => this.scenario = scenario;
Example #3
0
 public DoneHandler(HighContentionScenario scenario) => this.scenario = scenario;