public async Task DupeDetectionByInstanceStoreTest() { var sbService = (ServiceBusOrchestrationService)this.taskHub.orchestrationService; string name = NameVersionHelper.GetDefaultName(typeof(SimplestGreetingsOrchestration)); string version = NameVersionHelper.GetDefaultVersion(typeof(SimplestGreetingsOrchestration)); await this.taskHub.AddTaskOrchestrations(typeof(SimplestGreetingsOrchestration)) .AddTaskActivities(typeof(SimplestGetUserTask), typeof(SimplestSendGreetingTask)) .StartAsync(); // Write to jumpStart table only OrchestrationInstance id = await TestHelpers.CreateOrchestrationInstanceAsync(sbService, name, version, null, null, true, false); // Try to create orchestration with same instanceId OrchestrationAlreadyExistsException exception = await TestHelpers.ThrowsAsync <OrchestrationAlreadyExistsException>(() => TestHelpers.CreateOrchestrationInstanceAsync(sbService, name, version, id.InstanceId, null, false, false)); Assert.IsTrue(exception.Message.Contains("already exists")); }