コード例 #1
0
        public void SetUp()
        {
            _listener    = new SupportServiceStateListener();
            _listenerTwo = new SupportServiceStateListener();

            var config = SupportConfigFactory.GetConfiguration();

            _epService = EPServiceProviderManager.GetDefaultProvider(config);
            _epService.Initialize();
        }
コード例 #2
0
        private void RunAssertionListenerStateChange()
        {
            var               listener      = new SupportServiceStateListener();
            Configuration     configuration = SupportConfigFactory.GetConfiguration();
            EPServiceProvider epService     = EPServiceProviderManager.GetProvider(
                SupportContainer.Instance, this.GetType().Name + "__listenerstatechange", configuration);

            epService.ServiceInitialized      += listener.OnEPServiceInitialized;
            epService.ServiceDestroyRequested += listener.OnEPServiceDestroyRequested;
            epService.Dispose();
            Assert.AreSame(epService, listener.AssertOneGetAndResetDestroyedEvents());

            epService.Initialize();
            Assert.AreSame(epService, listener.AssertOneGetAndResetInitializedEvents());

            epService.RemoveAllServiceStateEventHandlers();
            epService.Initialize();
            Assert.IsTrue(listener.InitializedEvents.IsEmpty());

            epService.ServiceInitialized      += listener.OnEPServiceInitialized;
            epService.ServiceDestroyRequested += listener.OnEPServiceDestroyRequested;
            var listenerTwo = new SupportServiceStateListener();

            epService.ServiceInitialized      += listenerTwo.OnEPServiceInitialized;
            epService.ServiceDestroyRequested += listenerTwo.OnEPServiceDestroyRequested;
            epService.Initialize();
            Assert.AreSame(epService, listener.AssertOneGetAndResetInitializedEvents());
            Assert.AreSame(epService, listenerTwo.AssertOneGetAndResetInitializedEvents());

            epService.ServiceInitialized      -= listener.OnEPServiceInitialized;
            epService.ServiceDestroyRequested -= listener.OnEPServiceDestroyRequested;
            epService.Initialize();
            Assert.AreSame(epService, listenerTwo.AssertOneGetAndResetInitializedEvents());
            Assert.IsTrue(listener.InitializedEvents.IsEmpty());

            epService.Dispose();
        }
コード例 #3
0
 public void TearDown()
 {
     _listener    = null;
     _listenerTwo = null;
 }