public void TryToAddMoreThanThreeElementsToFilterTest() { var projectNotesService = new ProjectNotesServiceMock(5); var target = new OverviewWindowViewModel_Accessor(projectNotesService); var filter1 = new MetadataMock(new MetadataTypeMock { Name = "Sector" }, "Kriterium 1"); var filter2 = new MetadataMock(new MetadataTypeMock { Name = "Sector" }, "Kriterium 2"); var filter3 = new MetadataMock(new MetadataTypeMock { Name = "Sector" }, "Kriterium 3"); var filter4 = new MetadataMock(new MetadataTypeMock { Name = "Sector" }, "Kriterium 4"); Assert.AreEqual(0, target.Filters.Cast <IMetadata>().Count()); target.AddFilter(filter1); target.AddFilter(filter2); target.AddFilter(filter3); Assert.AreEqual(3, target.Filters.Cast <IMetadata>().Count()); target.AddFilter(filter4); Assert.AreEqual(3, target.Filters.Cast <IMetadata>().Count()); Assert.AreEqual(filter1, target.Filters.Cast <IMetadata>().ElementAt(0)); Assert.AreEqual(filter2, target.Filters.Cast <IMetadata>().ElementAt(1)); Assert.AreEqual(filter3, target.Filters.Cast <IMetadata>().ElementAt(2)); }
public void TryToAddElementTwiceToFilterTest() { var projectNotesService = new ProjectNotesServiceMock(5); var target = new OverviewWindowViewModel_Accessor(projectNotesService); var filter = new MetadataMock(new MetadataTypeMock { Name = "Sector" }, "Oberkriterium"); Assert.AreEqual(0, target.Filters.Cast <IMetadata>().Count()); target.AddFilter(filter); Assert.AreEqual(1, target.Filters.Cast <IMetadata>().Count()); target.AddFilter(filter); Assert.AreEqual(1, target.Filters.Cast <IMetadata>().Count()); }
public void AddAndRemoveAndCallbackFilterTest() { var projectNotesService = new ProjectNotesServiceMock(5); var target = new OverviewWindowViewModel_Accessor(projectNotesService); var filter = new MetadataMock(new MetadataTypeMock { Name = "Sector" }, "Oberkriterium"); target.AddFilter(filter); Assert.IsFalse(target.IsFilterViewVisible); Assert.IsFalse(target.IsDetailViewVisible); Assert.AreEqual(0, target.ProjectNotes.Count); target.RemoveFilter(filter); Assert.AreEqual(5, target.ProjectNotes.Count); }
public void AddAndRemoveFilterTest() { var projectNotesService = new ProjectNotesServiceMock(5, "Sector"); var n = projectNotesService.Metadata.Keys.ElementAt(0).Name; var target = new OverviewWindowViewModel_Accessor(projectNotesService); var filter = new MetadataMock(new MetadataTypeMock() { Name = "Sector" }, "Oberkriterium"); target.AddFilter(filter); Assert.AreEqual(target.IsFilterViewVisible, false); //Assert.AreEqual(target.ProjectNotes.Cast<IProjectNote>().Count(), 4); //target.RemoveFilter(filter); //Assert.AreEqual(target.ProjectNotes.Cast<IProjectNote>().Count(), 5); }