Exemplo n.º 1
0
        public void AssignTypeManagerCommandTest()
        {
            TreeViewViewModel treeViewViewModel = new TreeViewViewModel();

            Assert.IsNull(treeViewViewModel.TypeManagerInst);
            treeViewViewModel.FileDllPathOpener  = new TempFilePathOpener();
            treeViewViewModel.WriteMetadataToXml = new WriteMetadataToXml(treeViewViewModel);
            treeViewViewModel.AssignDataSourceDll.Execute(this);
            Assert.IsNotNull(treeViewViewModel.TypeManagerInst);
        }
Exemplo n.º 2
0
        public void TreeViewViewModelTest()
        {
            TreeViewViewModel treeViewViewModel = new TreeViewViewModel();

            Assert.AreEqual(new ObservableCollection <TreeViewTypeElement>().GetType(),
                            treeViewViewModel.ReferencedTypes.GetType());
            Assert.IsFalse(treeViewViewModel.HasTypeManager);
            DllTypeManager dllTypeManager = new DllTypeManager();
            string         pathToTest     = Environment.CurrentDirectory;

            for (int i = 0; i < 4; i++)
            {
                pathToTest = Directory.GetParent(pathToTest).FullName;
            }
            dllTypeManager.AssignPathToFile(Path.Combine(pathToTest, "testData\\TPA.ApplicationArchitecture.dll"));
            dllTypeManager.InitTypeManager();
            treeViewViewModel.TypeManagerInst = dllTypeManager;
            Assert.IsTrue(treeViewViewModel.ReferencedTypes.Count == 0);

            treeViewViewModel.ShowTreeViewCommand.Execute(this);
            Assert.IsTrue(treeViewViewModel.ReferencedTypes.Count > 0);
        }
Exemplo n.º 3
0
 public ShowTreeViewCommand(TreeViewViewModel treeViewViewModel)
 {
     _treeViewViewModel = treeViewViewModel;
 }
Exemplo n.º 4
0
 public AssignDataSourceCommand(TreeViewViewModel treeViewViewModel)
 {
     _treeViewViewModel = treeViewViewModel;
 }
Exemplo n.º 5
0
 public WriteMetadataToXml(TreeViewViewModel treeViewViewModel)
 {
     _treeViewViewModel = treeViewViewModel;
 }
Exemplo n.º 6
0
 public AssignXmlTypeManagerCommand(TreeViewViewModel treeViewViewModel) : base(treeViewViewModel)
 {
 }