コード例 #1
0
        public void GetScope_KeyNotFound()
        {
            // arrange, act
            var ex = Capture <KeyNotFoundException>(
                () => OrchestrationScope.GetScope(Guid.NewGuid().ToString()));

            // assert
            ex.Should().NotBeNull();
        }
コード例 #2
0
        public void GetScope_ArgumentNull()
        {
            // arrange, act
            var ex = Capture <ArgumentNullException>(
                () => OrchestrationScope.GetScope(null));

            // assert
            ex.Should().NotBeNull();
        }
コード例 #3
0
        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();
        }
コード例 #4
0
        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();
        });