コード例 #1
0
        public void ClearTest()
        {
            var listener = new GenericHandler <object>();
            IEventAggregator eventAggregator = CreateEventAggregator();

            eventAggregator.Subscribe(listener);
            eventAggregator.GetObservers().Contains(listener).ShouldBeTrue();
            eventAggregator.GetObservers().Count.ShouldEqual(1);

            eventAggregator.Clear();
            eventAggregator.GetObservers().Count.ShouldEqual(0);
        }