public async Task <EndpointConfiguration> GetConfiguration(RunDescriptor runDescriptor, EndpointCustomizationConfiguration endpointConfiguration, Action <EndpointConfiguration> configurationBuilderCustomization)
        {
            var types = endpointConfiguration.GetTypesScopedByTestClass();

            var configuration = new EndpointConfiguration(endpointConfiguration.EndpointName);

            configuration.TypesToIncludeInScan(types);
            configuration.EnableInstallers();

            var recoverability = configuration.Recoverability();

            recoverability.Delayed(delayed => delayed.NumberOfRetries(0));
            recoverability.Immediate(immediate => immediate.NumberOfRetries(0));
            configuration.SendFailedMessagesTo("error");

            var transportConfiguration = new ConfigureEndpointAcceptanceTestingTransport(useNativePubSub, true);
            await transportConfiguration.Configure(endpointConfiguration.EndpointName, configuration, runDescriptor.Settings, endpointConfiguration.PublisherMetadata);

            runDescriptor.OnTestCompleted(_ => transportConfiguration.Cleanup());

            configuration.RegisterComponentsAndInheritanceHierarchy(runDescriptor);

            var persistenceConfiguration = new ConfigureEndpointAcceptanceTestingPersistence();
            await persistenceConfiguration.Configure(endpointConfiguration.EndpointName, configuration, runDescriptor.Settings, endpointConfiguration.PublisherMetadata);

            runDescriptor.OnTestCompleted(_ => persistenceConfiguration.Cleanup());

            configurationBuilderCustomization(configuration);

            return(configuration);
        }
예제 #2
0
        public static async Task DefinePersistence(this EndpointConfiguration config, RunDescriptor runDescriptor, EndpointCustomizationConfiguration endpointCustomizationConfiguration)
        {
            var persistenceConfiguration = new ConfigureEndpointAcceptanceTestingPersistence();
            await persistenceConfiguration.Configure(config);

            runDescriptor.OnTestCompleted(_ => persistenceConfiguration.Cleanup());
        }