public void TestRemove2()
        {
            _settings = new ApplicationSettings("foobar");
            var group = new DataSource {Id = Guid.NewGuid()};
            var source1 = new DataSource("foo") {Id = Guid.NewGuid(), ParentId = group.Id};
            var source2 = new DataSource("bar") {Id = Guid.NewGuid(), ParentId = group.Id};
            var source3 = new DataSource("clondyke") {Id = Guid.NewGuid(), ParentId = group.Id};
            _settings.DataSources.Add(source1);
            _settings.DataSources.Add(source2);
            _settings.DataSources.Add(source3);
            _settings.DataSources.Add(group);
            _dataSources = new DataSources(_scheduler, _settings.DataSources);
            _model = new DataSourcesViewModel(_settings, _dataSources);
            var merged = (MergedDataSourceViewModel) _model.Observable[0];
            IDataSourceViewModel viewModel1 = merged.Observable.ElementAt(0);
            IDataSourceViewModel viewModel2 = merged.Observable.ElementAt(1);
            IDataSourceViewModel viewModel3 = merged.Observable.ElementAt(2);
            viewModel1.RemoveCommand.Execute(null);

            merged.ChildCount.Should().Be(2);
            merged.Observable.Should().NotContain(viewModel1);
            _model.Observable.Should().Equal(new object[] {merged});
            _dataSources.Should().Equal(new object[] {viewModel2.DataSource, viewModel3.DataSource, merged.DataSource});
            _settings.DataSources.Should().Equal(new object[] {source2, source3, group});
        }
        public void TestRemove1()
        {
            _settings = new ApplicationSettings("foobar");
            var source = new DataSource("foo") {Id = Guid.NewGuid()};
            _settings.DataSources.Add(source);
            _dataSources = new DataSources(_scheduler, _settings.DataSources);
            _model = new DataSourcesViewModel(_settings, _dataSources);
            IDataSourceViewModel viewModel = _model.Observable[0];
            viewModel.RemoveCommand.Execute(null);

            _model.Observable.Should().BeEmpty();
            _dataSources.Should().BeEmpty();
            _settings.DataSources.Should().BeEmpty();
        }