예제 #1
0
        public void GetOrCreateScope_Created()
        {
            // arrange
            string instanceId = Guid.NewGuid().ToString();

            // act
            IOrchestrationScope scope = OrchestrationScope.GetOrCreateScope(instanceId, GetServiceProvider());

            // assert
            scope.Should().NotBeNull();
            scope.ServiceProvider.Should().NotBeNull();
        }
예제 #2
0
        public void GetOrCreateScope_Found()
        {
            // arrange
            string instanceId = Guid.NewGuid().ToString();

            // act
            IOrchestrationScope first  = OrchestrationScope.CreateScope(instanceId, GetServiceProvider());
            IOrchestrationScope second = OrchestrationScope.GetOrCreateScope(instanceId, GetServiceProvider());

            // assert
            second.Should().NotBeNull();
            second.ServiceProvider.Should().NotBeNull();
            second.Should().BeSameAs(first);
        }