public void unsubscribes_self_from_event_aggregator_on_dispose()
        {
            // arrange
            var eventAggregator = Substitute.For <IEventAggregator>();
            var testItem        = new TestItem(eventAggregator);

            // act
            testItem.Dispose();

            //assert
            eventAggregator.Received().Unsubscribe(testItem);
        }
        public void unsubscribes_self_from_event_aggregator_on_dispose()
        {
            // arrange
            var eventAggregator = Substitute.For<IEventAggregator>();
            var testItem = new TestItem(eventAggregator);

            // act
            testItem.Dispose();

            //assert
            eventAggregator.Received().Unsubscribe(testItem);
        }
        public void disposes_children_on_dispose()
        {
            // arrange
            var eventAggregator = Substitute.For <IEventAggregator>();
            var testItem        = new TestItem(eventAggregator);
            var child           = new TestItem(eventAggregator);

            testItem.Children.Add(child);

            // act
            testItem.Dispose();

            // assert
            Assert.True(child.Disposed);
        }
        public void disposes_children_on_dispose()
        {
            // arrange
            var eventAggregator = Substitute.For<IEventAggregator>();
            var testItem = new TestItem(eventAggregator);
            var child = new TestItem(eventAggregator);
            testItem.Children.Add(child);

            // act
            testItem.Dispose();

            // assert
            Assert.True(child.Disposed);
        }