public void TestCancelCommand()
        {
            HashSetManagementDialogViewModelTest();
            var newHashSetName = "newHashSetName";
            var newDescription = "description Text";
            var newEnabled     = true;

            _vm.HashSetModels[0].HashSetName        = newHashSetName;
            _vm.HashSetModels[0].HashSetDescription = newDescription;
            _vm.HashSetModels[0].HashSetEnabled     = newEnabled;

            _vm.CancelCommand.Execute();

            //检查属性是否不一致,确认更改未生效;
            void CheckPropsUnMatched()
            {
                Assert.AreNotEqual(HashSetManagementService.HashSets.First().Name, newHashSetName);
                Assert.AreNotEqual(HashSetManagementService.HashSets.First().Description, newDescription);
                Assert.AreNotEqual(HashSetManagementService.HashSets.First().IsEnabled, newEnabled);
            };

            CheckPropsUnMatched();

            HashSetManagementService.Initialize();

            CheckPropsUnMatched();

            Assert.AreNotEqual(HashSetManagementService.HashSets.First().Name, newHashSetName);
        }
        public void Initialize()
        {
            TestCommon.InitializeTest();
            HashSetManagementService.Initialize();
            HashSetManagementService.Current.ClearHashSets();

            var hashSet = HashSetFactory.CreateNew(
                "E:\\anli\\lucene",
                Guid.NewGuid().ToString("P"),
                GenericServiceStaticInstances <IHasher> .Currents.First(
                    p => p.GUID == SingularityForensic.Hash.Constants.HashTypeGUID_MD5
                    )
                );

            hashSet.Name = testHashSetName;
            HashSetManagementService.AddHashSet(hashSet);


            _vm = new HashSetManagementDialogViewModel();
            _vm.Initialize();
        }