public void Create_OpenGeneric_NotNull(Type type) { var manager = new GenericObjectManager <TaskActivity>(); manager.Add(new ActivityObjectCreator(new TaskActivityDescriptor(typeof(TestActivity <>)))); TaskActivity activity = manager.GetObject(TypeShortName.ToString(type, false), string.Empty); activity.Should().NotBeNull(); activity.As <WrapperActivity>().Descriptor.Type.Should().Be(type); }
public void Create_Exists_NotNull() { var manager = new GenericObjectManager <TaskActivity>(); manager.Add(new ActivityObjectCreator(s_descriptor)); TaskActivity activity = manager.GetObject(s_descriptor.Name, s_descriptor.Version); activity.Should().NotBeNull(); activity.As <WrapperActivity>().Descriptor.Type.Should().Be(s_descriptor.Type); }
public void Create_ClosedGeneric_NotNull() { var descriptor = TaskActivityDescriptor.Create <TestActivity <object> >(); var manager = new GenericObjectManager <TaskActivity>(); manager.Add(new ActivityObjectCreator(descriptor)); TaskActivity activity = manager.GetObject(descriptor.Name, descriptor.Version); activity.Should().NotBeNull(); activity.As <WrapperActivity>().Descriptor.Type.Should().Be(descriptor.Type); TaskActivity activity2 = manager.GetObject(typeof(TestActivity <int>).FullName, descriptor.Version); activity2.Should().BeNull(); }