public void Verify_that_registering_bad_view_does_not_work() { var filterStringService = new FilterStringService(); Assert.AreEqual(0, filterStringService.OpenDeprecatedViewModels.Count); Assert.AreEqual(0, filterStringService.OpenFavoriteViewModels.Count); filterStringService.RegisterForService(this.badViewModel.Object); filterStringService.RegisterForService(this.badViewModel.Object); Assert.AreEqual(0, filterStringService.OpenDeprecatedViewModels.Count); Assert.AreEqual(0, filterStringService.OpenFavoriteViewModels.Count); }
public void VerifyThatRegisteringDeprecatedBrowserViewModelWorks() { var deprecatable = new Mock <IDeprecatableBrowserViewModel>(); var filterable = deprecatable.As <IPanelFilterableDataGridViewModel>(); filterable.SetupAllProperties(); var panel = filterable.As <IPanelViewModel>(); var filterStringService = new FilterStringService(); filterStringService.RegisterForService(panel.Object); Assert.That(filterStringService.OpenDeprecatedViewModels.Single(), Is.EqualTo(panel.Object)); Assert.IsTrue(filterable.Object.IsFilterEnabled); Assert.That(filterable.Object.FilterString, Is.EqualTo("[IsDeprecated]=False")); }
public void VerifyThatRegisteringFavouritesBrowserViewModelWorks() { var favourites = new Mock <IFavoritesBrowserViewModel>(); favourites.SetupAllProperties(); var filterable = favourites.As <IPanelFilterableDataGridViewModel>(); filterable.SetupAllProperties(); var panel = filterable.As <IPanelViewModel>(); ((IFavoritesBrowserViewModel)panel.Object).ShowOnlyFavorites = true; var filterStringService = new FilterStringService(); filterStringService.ShowDeprecatedThings = true; filterStringService.RegisterForService(panel.Object); Assert.That(filterStringService.OpenFavoriteViewModels.Single(), Is.EqualTo(panel.Object)); Assert.IsTrue(filterable.Object.IsFilterEnabled); Assert.That(filterable.Object.FilterString, Is.EqualTo("[IsFavorite]=True")); }