コード例 #1
0
        public void OnCurrentMainCriteriaChangedTest()
        {
            var projectNotesService = new ProjectNotesServiceMock(1);
            var metadataTypeSector  = new MetadataTypeMock {
                Name = "Sektor"
            };
            var metadataTypeCustomer = new MetadataTypeMock {
                Name = ""
            };
            var metadataSector = new MetadataMock {
                Description = "Sektorkriterium"
            };
            var metadataCustomer = new MetadataMock {
                Description = "Kundenkriterium"
            };

            projectNotesService.Metadata = new Dictionary <IMetadataType, ICollection <IMetadata> >
            {
                { metadataTypeSector, new List <IMetadata> {
                      metadataSector
                  } },
                { metadataTypeCustomer, new List <IMetadata> {
                      metadataCustomer
                  } }
            };

            var target = new OverviewWindowViewModel_Accessor(projectNotesService);

            target.ShowSubcriteriaCommand.Execute(metadataTypeCustomer);

            var c = target.Maincriteria.Cast <IMetadataType>().ElementAt(0);

            target.OnCurrentMainCriteriaChanged(c);
            Assert.AreEqual(target.Subcriteria.Cast <IMetadata>().ElementAt(0).Description, metadataSector.Description);
        }
コード例 #2
0
        public void OnCurrentMainCriteriaChangedTest()
        {
            IProjectNotesService             projectNotesService = new ProjectNotesServiceMock(1);
            OverviewWindowViewModel_Accessor target = new OverviewWindowViewModel_Accessor(projectNotesService);

            Assert.IsNull(target.Subcriteria);
            target.OnCurrentMainCriteriaChanged(new object(), null);
            Assert.IsNotNull(target.Subcriteria);
        }