Example #1
0
        public void FilteredNavigationViewModel_AfterReload_Expects_FilteredItemsInTreeWithIsFilteredTrue()
        {
            Init(false, true);
            var resourceVM = _vm.FindChild(_mockResourceModel.Object);

            Assert.IsNotNull(resourceVM);

            Assert.AreEqual(4, _vm.ExplorerItemModels[0].ChildrenCount);

            _vm.UpdateSearchFilter("Mock2");
            resourceVM = _vm.FindChild(_mockResourceModel.Object);
            Assert.AreEqual(1, _vm.ExplorerItemModels[0].ChildrenCount);
            Assert.IsNull(resourceVM);

            //_vm.LoadEnvironmentResources(_mockEnvironmentModel.Object);
            resourceVM = _vm.FindChild(_mockResourceModel.Object);

            Assert.AreEqual(1, _vm.ExplorerItemModels[0].ChildrenCount);
            Assert.IsNull(resourceVM);
            _vm.UpdateSearchFilter("Mock");
            resourceVM = _vm.FindChild(_mockResourceModel.Object);
            Assert.AreEqual(4, _vm.ExplorerItemModels[0].ChildrenCount);
            Assert.IsNotNull(resourceVM);
        }