public TheoryItem Resolve()
        {
            var item = new TheoryItem(this.name);

            switch (this.setup)
            {
            case TheoryItemSetup.AsStatefulEventSource:
                item.SetupExtensionsAsEventSource()
                .SetupConfigAsStatefulService(TheoryItemConfigure.ConfigureEventSourceExtensions);
                break;

            case TheoryItemSetup.AsStatelessEventSource:
                item.SetupExtensionsAsEventSource()
                .SetupConfigAsStatelessService(TheoryItemConfigure.ConfigureEventSourceExtensions);
                break;

            case TheoryItemSetup.AsStatefulDelegate:
                item.SetupExtensionsAsStatefulDelegate()
                .SetupConfigAsStatefulService(TheoryItemConfigure.ConfigureDelegateExtensions);
                break;

            case TheoryItemSetup.AsStatelessDelegate:
                item.SetupExtensionsAsStatelessDelegate()
                .SetupConfigAsStatelessService(TheoryItemConfigure.ConfigureDelegateExtensions);
                break;

            case TheoryItemSetup.AsStatefulAspNetCoreListener:
                item.SetupExtensionsAsAspNetCoreListener()
                .SetupConfigAsStatefulService(TheoryItemConfigure.ConfigureAspNetCoreListenerExtensions);
                break;

            case TheoryItemSetup.AsStatelessAspNetCoreListener:
                item.SetupExtensionsAsAspNetCoreListener()
                .SetupConfigAsStatelessService(TheoryItemConfigure.ConfigureAspNetCoreListenerExtensions);
                break;

            case TheoryItemSetup.AsStatefulRemotingListener:
                item.SetupExtensionsAsRemotingListener()
                .SetupConfigAsStatefulService(TheoryItemConfigure.ConfigureRemotingListenerExtensions);
                break;

            case TheoryItemSetup.AsStatelessRemotingListener:
                item.SetupExtensionsAsRemotingListener()
                .SetupConfigAsStatelessService(TheoryItemConfigure.ConfigureRemotingListenerExtensions);
                break;

            case TheoryItemSetup.AsStatefulGenericListener:
                item.SetupExtensionsAsGenericListener()
                .SetupConfigAsStatefulService(TheoryItemConfigure.ConfigureGenericListenerExtensions);
                break;

            case TheoryItemSetup.AsStatelessGenericListener:
                item.SetupExtensionsAsGenericListener()
                .SetupConfigAsStatelessService(TheoryItemConfigure.ConfigureGenericListenerExtensions);
                break;
            }

            return(item);
        }
 public static TheoryItem SetupExtensionsAsStatelessDelegate(
     this TheoryItem @this)
 {
     return(@this
            .SetupExtension(new UseStatelessDelegateInvokerTheoryExtension())
            .SetupExtension(new UseStatelessDelegateEventTheoryExtension())
            .SetupExtensionsAsDelegate());
 }
 private static TheoryItem SetupExtensionsAsDelegate(
     this TheoryItem @this)
 {
     return(@this
            .SetupExtension(new UseDependenciesTheoryExtension())
            .SetupExtension(new UseDelegateTheoryExtension())
            .SetupExtension(new ConfigureDependenciesTheoryExtension())
            .SetupExtension(new PickDependencyTheoryExtension()));
 }
 public static TheoryItem SetupExtensionsAsEventSource(
     this TheoryItem @this)
 {
     return(@this
            .SetupExtension(new UseDependenciesTheoryExtension())
            .SetupExtension(new UseEventSourceImplementationTheoryExtension())
            .SetupExtension(new ConfigureDependenciesTheoryExtension())
            .SetupExtension(new PickDependencyTheoryExtension()));
 }
 public static TheoryItem SetupExtensionsAsAspNetCoreListener(
     this TheoryItem @this)
 {
     return(@this
            .SetupExtension(new UseListenerEndpointTheoryExtension())
            .SetupExtension(new UseAspNetCoreListenerCommunicationListenerTheoryExtension())
            .SetupExtension(new UseAspNetCoreListenerWebHostBuilderTheoryExtension())
            .SetupExtension(new ConfigureDependenciesTheoryExtension())
            .SetupExtension(new PickDependencyTheoryExtension())
            .SetupExtension(new PickListenerEndpointTheoryExtension()));
 }
 public static TheoryItem SetupExtensionsAsGenericListener(
     this TheoryItem @this)
 {
     return(@this
            .SetupExtension(new UseListenerEndpointTheoryExtension())
            .SetupExtension(new UseGenericListenerCommunicationListenerTheoryExtension())
            .SetupExtension(new UseDependenciesTheoryExtension())
            .SetupExtension(new ConfigureDependenciesTheoryExtension())
            .SetupExtension(new PickDependencyTheoryExtension())
            .SetupExtension(new PickListenerEndpointTheoryExtension()));
 }
 public static TheoryItem SetupExtensionsAsRemotingListener(
     this TheoryItem @this)
 {
     return(@this
            .SetupExtension(new UseListenerEndpointTheoryExtension())
            .SetupExtension(new UseRemotingListenerCommunicationListenerTheoryExtension())
            .SetupExtension(new UseRemotingListenerImplementationTheoryExtension())
            .SetupExtension(new UseRemotingListenerSettingsTheoryExtension())
            .SetupExtension(new UseRemotingListenerSerializationProviderTheoryExtension())
            .SetupExtension(new UseRemotingListenerHandlerTheoryExtension())
            .SetupExtension(new UseDependenciesTheoryExtension())
            .SetupExtension(new ConfigureDependenciesTheoryExtension())
            .SetupExtension(new PickDependencyTheoryExtension())
            .SetupExtension(new PickListenerEndpointTheoryExtension())
            .SetupExtension(new PickRemotingListenerImplementationTheoryExtension())
            .SetupExtension(new PickRemotingListenerSettingsTheoryExtension())
            .SetupExtension(new PickRemotingListenerSerializationProviderTheoryExtension())
            .SetupExtension(new PickRemotingListenerHandlerTheoryExtension()));
 }
        public static TheoryItem SetupConfigAsStatelessService(
            this TheoryItem @this,
            Action <IStatelessServiceHostBuilderConfigurator, TheoryItem.TheoryItemExtensionProvider> configAction)
        {
            return(@this
                   .SetupConfig(
                       (
                           builder,
                           extensions) =>
            {
                builder.DefineStatelessService(
                    serviceBuilder =>
                {
                    serviceBuilder
                    .ConfigureObject(
                        c =>
                    {
                        c.UseRuntimeRegistrant(provider => new MockStatelessServiceRuntimeRegistrant());

                        configAction(c, extensions);
                    });
                });
            }));
        }
 public TheoryItemExtensionProvider(
     TheoryItem item)
 {
     this.item = item;
 }