static async Task ImportIntoCosmosDB(Context scenarioContext) { var container = SetupFixture.Container; var actualSagaId = CosmosSagaIdGenerator.Generate(typeof(MigratingEndpoint.MigratingFromAsp2SagaData), nameof(MigratingEndpoint.MigratingFromAsp2SagaData.MyId), scenarioContext.MyId); string document = string.Format(MigrationDocument, scenarioContext.MigratedSagaId, actualSagaId, scenarioContext.MyId); 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"); } }
public void Should_return_the_same_guid_as_previous(string fullname, string propertyName, string propertyValue) => Assert.AreEqual(PreviousCosmosSagaIdGenerator.Generate(fullname, propertyName, propertyValue), CosmosSagaIdGenerator.Generate(fullname, propertyName, propertyValue));
public void Should_return_the_same_guid_regardless_of_the_tfm() => Assert.AreEqual(new Guid("c718ea15-a555-f79f-fa37-62477f3b07ca"), CosmosSagaIdGenerator.Generate("SagaEntityTypeFullName", "CorrelationPropertyName", "SomeValue"));