public void CorrectlyInitialize()
        {
            ContentBodyViewModel viewModel = new ContentBodyViewModel();

            Assert.AreEqual(0, viewModel.Items.Count );
            Assert.IsNull(viewModel.SelectedItem);
        }
        public void RemoveColonOnSearchLabelWhenSearchIsEmpty()
        {
            ContentBodyViewModel viewModel = new ContentBodyViewModel();

            ContentBodyObserver.NotifyNewSeach(new ObservableCollection<Song>(), string.Empty);

            Assert.AreEqual(1, viewModel.Items.Count);
            Assert.AreEqual("Search", viewModel.Items[0].Label);
            Assert.AreEqual(viewModel.Items[0], viewModel.SelectedItem);
        }
        public void RemoveItemOnCloseDemand()
        {
            const string label = "label";
            Mock<IBodyView> view = new Mock<IBodyView>();
            MenuItem item = new MenuItem { Label = label, View = view.Object };
            ContentBodyViewModel viewModel = new ContentBodyViewModel {Items = new ObservableCollection<MenuItem> {item}};

            viewModel.CloseCommand.Execute(item);

            Assert.AreEqual(0, viewModel.Items.Count);
        }
        public void OpenNewSongListViewWhenNewSearchEventIsCatched()
        {
            const string search = "label";
            ContentBodyViewModel viewModel = new ContentBodyViewModel();

            ContentBodyObserver.NotifyNewSeach(new ObservableCollection<Song>(), search);

            Assert.AreEqual(1, viewModel.Items.Count);
            Assert.AreEqual("Search : " + search, viewModel.Items[0].Label);
            Assert.AreEqual(viewModel.Items[0], viewModel.SelectedItem);
        }
        public void RefreshItemsWhenAnChangeContentViewEventIsCatched()
        {
            const string label = "label";
            Mock<IBodyView> view = new Mock<IBodyView>();
            MenuItem item = new MenuItem {Label = label, View = view.Object};
            ContentBodyViewModel viewModel = new ContentBodyViewModel();

            ContentBodyObserver.NotifyChangeContentView(item);

            Assert.AreEqual(1, viewModel.Items.Count);
            Assert.AreEqual(item, viewModel.Items[0]);
            Assert.AreEqual(item, viewModel.SelectedItem);
        }