public AcceptanceTestingTransportInfrastructure(HostSettings settings, AcceptanceTestingTransport transportSettings, ReceiveSettings[] receiverSettings)
        {
            this.settings          = settings;
            this.transportSettings = transportSettings;
            this.receiverSettings  = receiverSettings;

            storagePath = transportSettings.StorageLocation ?? Path.Combine(FindSolutionRoot(), ".attransport");
        }
    public Task Configure(string endpointName, EndpointConfiguration configuration, RunSettings settings, PublisherMetadata publisherMetadata)
    {
        var testRunId = TestContext.CurrentContext.Test.ID;

        string tempDir;

        if (Environment.OSVersion.Platform == PlatformID.Win32NT)
        {
            //can't use bin dir since that will be too long on the build agents
            tempDir = @"c:\temp";
        }
        else
        {
            tempDir = Path.GetTempPath();
        }

        storageDir = Path.Combine(tempDir, "acc", testRunId);

        var acceptanceTestingTransport = new AcceptanceTestingTransport(
            enableNativeDelayedDelivery: useNativeDelayedDelivery,
            enableNativePublishSubscribe: useNativePubSub)
        {
            StorageLocation = storageDir,
        };

        if (transactionMode.HasValue)
        {
            acceptanceTestingTransport.TransportTransactionMode = transactionMode.Value;
        }

        var routing = configuration.UseTransport(acceptanceTestingTransport);

        if (!useNativePubSub)
        {
            //apply publisher registrations required for message driven pub/sub
            foreach (var publisherMetadataPublisher in publisherMetadata.Publishers)
            {
                foreach (var @event in publisherMetadataPublisher.Events)
                {
                    routing.RegisterPublisher(@event, publisherMetadataPublisher.PublisherName);
                }
            }
        }

        return(Task.FromResult(0));
    }