예제 #1
0
        public void GetOrAddFeature_WithExistingFeature_ShouldInvokeFactoryOnlyFirstTimeAndReturnTheSameInstance()
        {
            var feature = new object();

            object Factory(IScopedAppServiceProvider x) => feature;

            var feature1 = _eventsScope.GetOrAddFeature(Factory);
            var feature2 = _eventsScope.GetOrAddFeature(x => new object());

            Assert.That(feature, Is.EqualTo(feature1).And.EqualTo(feature2));
        }
 public static IEventsScopeQueuesFeature GetQueuesFeature(this IEventsScope eventsScope)
 {
     return(eventsScope.GetOrAddFeature <IEventsScopeQueuesFeature>(x => new EventsScopeQueuesFeature()));
 }
예제 #3
0
 public static IEventsScopeSubscriptionsFeature GetSubscriptionsFeature(this IEventsScope eventsScope)
 {
     return(eventsScope.GetOrAddFeature <IEventsScopeSubscriptionsFeature>(
                x => new EventsScopeSubscriptionsFeature(x)
                ));
 }