Beispiel #1
0
 public EventSubscriber(ISubscriptionClientFactory subscriptionClientFactory,
                        IServiceProvider inversionOfControlContainer,
                        IEventSubscriberConfiguration configuration,
                        ILogger logger)
 {
     InitializeInstance(subscriptionClientFactory, inversionOfControlContainer, configuration, logger);
 }
Beispiel #2
0
        public void TestInitialize()
        {
            fixture = new Fixture().Customize(new AutoNSubstituteCustomization());
            inversionOfControlContainer = fixture.Freeze <IServiceProvider>();
            configuration             = fixture.Freeze <IEventSubscriberConfiguration>();
            subscriptionClientFactory = fixture.Freeze <ISubscriptionClientFactory>();
            logger = fixture.Freeze <ILogger>();

            IList <SubscriptionInfo> subscriptionsConfig = new List <SubscriptionInfo>
            {
                new SubscriptionInfo(
                    typeof(FakeEvent1),
                    typeof(FakeEvent1Handler),
                    TopicName1,
                    Subscriptioname1,
                    RetryPolicyBase.DefaultRetry),
                new SubscriptionInfo(
                    typeof(FakeEvent2),
                    typeof(FakeEvent2Handler),
                    TopicName2,
                    Subscriptioname2,
                    RetryPolicyBase.DefaultRetry)
            };

            configuration.ServiceBusConnectionString.Returns(fixture.Create <string>());
            configuration.Subscriptions.Returns(subscriptionsConfig);

            sut = fixture.Create <EventSubscriber>();
        }