public void GetScope_KeyNotFound() { // arrange, act var ex = Capture <KeyNotFoundException>( () => OrchestrationScope.GetScope(Guid.NewGuid().ToString())); // assert ex.Should().NotBeNull(); }
public void GetScope_ArgumentNull() { // arrange, act var ex = Capture <ArgumentNullException>( () => OrchestrationScope.GetScope(null)); // assert ex.Should().NotBeNull(); }
public void GetScope_ScopeFound() { // arrange string instanceId = Guid.NewGuid().ToString(); OrchestrationScope.CreateScope(instanceId, GetServiceProvider()); // act IOrchestrationScope scope = OrchestrationScope.GetScope(instanceId); // assert scope.Should().NotBeNull(); scope.ServiceProvider.Should().NotBeNull(); }
public Task Execute_DisposesScope() => RunTestAsync( typeof(TestOrchestration), async wrapper => { CreateScope(); wrapper.InnerOrchestration = (TaskOrchestration)Activator.CreateInstance(wrapper.InnerOrchestrationType, this); await wrapper.Execute(s_orchestrationContext, Input); return(Capture <KeyNotFoundException>( () => OrchestrationScope.GetScope(InstanceId))); }, (wrapper, ex) => { ex.Should().NotBeNull(); });