public void CreateWithName_NotGeneric_Throws()
        {
            var    descriptor = TaskOrchestrationDescriptor.Create <TestOrchestration>();
            var    creator    = new OrchestrationObjectCreator(descriptor);
            Action act        = () => creator.Create(new TypeShortName(typeof(string)));

            act.Should().ThrowExactly <InvalidOperationException>();
        }
예제 #2
0
        public void Create_ConcreteType_Succeeds()
        {
            var descriptor = TaskOrchestrationDescriptor.Create <TestOrchestration>();

            descriptor.Should().NotBeNull();
            descriptor.Type.Should().Be(typeof(TestOrchestration));
            descriptor.Name.Should().Be(typeof(TestOrchestration).FullName);
            descriptor.Version.Should().BeEmpty();
        }
        public void Create_WrapperCreated()
        {
            var descriptor = TaskOrchestrationDescriptor.Create <TestOrchestration>();
            var creator    = new OrchestrationObjectCreator(descriptor);
            TaskOrchestration Orchestration = creator.Create();

            Orchestration.Should().NotBeNull();
            Orchestration.Should().BeOfType <WrapperOrchestration>()
            .Which.Descriptor.Should().Be(descriptor);
        }
예제 #4
0
        public void Create_SuppliedNameVersion()
        {
            const string name       = "CustomName";
            const string version    = "CustomVersion";
            var          descriptor = TaskOrchestrationDescriptor.Create <TestOrchestration>(name, version);

            descriptor.Should().NotBeNull();
            descriptor.Type.Should().Be(typeof(TestOrchestration));
            descriptor.Name.Should().Be(name);
            descriptor.Version.Should().Be(version);
        }
예제 #5
0
        public void Create_AbstractType_Fails()
        {
            Action act = () => TaskOrchestrationDescriptor.Create <TaskOrchestration>();

            act.Should().ThrowExactly <ArgumentException>();
        }