示例#1
0
        protected AzureServiceBusTestFixture(AzureServiceBusTestHarness harness)
            : base(harness)
        {
            AzureServiceBusTestHarness = harness;

            AzureServiceBusTestHarness.OnConfigureServiceBusBus             += ConfigureServiceBusBus;
            AzureServiceBusTestHarness.OnConfigureServiceBusReceiveEndpoint += ConfigureServiceBusReceiveEndpoint;
        }
示例#2
0
        public void CreateHarness()
        {
            if (HarnessType == typeof(InMemoryTestHarness))
            {
                Harness = new InMemoryTestHarness();
            }
            else if (HarnessType == typeof(RabbitMqTestHarness))
            {
                var harness = new RabbitMqTestHarness();

                Harness = harness;

                harness.OnConfigureRabbitMqReceiveEndoint += x => x.BindMessageExchanges = Subscribe;
            }
            else if (HarnessType == typeof(ActiveMqTestHarness))
            {
                var harness = new ActiveMqTestHarness();

                Harness = harness;

                harness.OnConfigureActiveMqReceiveEndoint += x => x.BindMessageTopics = Subscribe;
            }
            else if (HarnessType == typeof(AzureServiceBusTestHarness))
            {
                var serviceUri = Credentials.AzureServiceUri;

                var harness = new AzureServiceBusTestHarness(serviceUri, Credentials.AzureKeyName, Credentials.AzureKeyValue);

                Harness = harness;

                harness.OnConfigureServiceBusReceiveEndpoint += x => x.SubscribeMessageTopics = Subscribe;
            }
            else if (HarnessType == typeof(AmazonSqsTestHarness))
            {
                var harness = new AmazonSqsTestHarness(Credentials.AmazonRegion, Credentials.AmazonAccessKey, Credentials.AmazonSecretKey);

                Harness = harness;

                harness.OnConfigureAmazonSqsReceiveEndpoint += x => x.SubscribeMessageTopics = Subscribe;
            }
            else
            {
                throw new ArgumentException($"Unknown test harness type: {TypeCache.GetShortName(HarnessType)}");
            }
        }