//TODO Error while using Save operation #129 work on the test public void CreateNewModelTest() { String _currentFolder = Directory.GetCurrentDirectory(); Mock <ISolutionDirectoryPathManagement> _directory = new Mock <ISolutionDirectoryPathManagement>(); _directory.SetupGet(x => x.BaseDirectory).Returns(@"C:\"); CheckConsistency(ProjectTreeNode.CreateNewModel(_directory.Object)); Assert.AreEqual <string>(_currentFolder, Directory.GetCurrentDirectory()); }
public void CreateTest() { Mock <ISolutionDirectoryPathManagement> _directory = new Mock <ISolutionDirectoryPathManagement>(); _directory.SetupGet(x => x.BaseDirectory).Returns(@"C:\"); ProjectTreeNode _emptyModel = ProjectTreeNode.CreateNewModel(_directory.Object); IViewModel _viewModel = _emptyModel.Create(); Assert.IsNotNull(_viewModel); }
public void FindTest() { Mock <ISolutionDirectoryPathManagement> _directory = new Mock <ISolutionDirectoryPathManagement>(); _directory.SetupGet(x => x.BaseDirectory).Returns(@"C:\"); ProjectTreeNode _emptyModel = ProjectTreeNode.CreateNewModel(_directory.Object); XmlQualifiedName _toFind = new XmlQualifiedName("Name", "Namespace"); ITypeDesign _findReturn = _emptyModel.Find(_toFind); Assert.IsNull(_findReturn); }
public void GetTargetNamespaceTest() { Mock <ISolutionDirectoryPathManagement> _directory = new Mock <ISolutionDirectoryPathManagement>(); string _solutionDir = Path.Combine(Directory.GetCurrentDirectory(), "Temp"); Directory.CreateDirectory(_solutionDir); _directory.SetupGet(x => x.BaseDirectory).Returns(_solutionDir); ProjectTreeNode _emptyModel = ProjectTreeNode.CreateNewModel(_directory.Object); _emptyModel.Save(); string _expectedModelFileName = Path.Combine(_solutionDir, _emptyModel.FileName); Assert.IsTrue(File.Exists(_expectedModelFileName), _expectedModelFileName); }
public void AddProject(bool existing) { ProjectTreeNode _node = null; if (existing) { _node = ProjectTreeNode.ImportNodeSet(HomeDirectory, x => AssemblyTraceEvent.Tracer.TraceEvent(x.TraceLevel, 486245093, x.ToString()), OPCFModelConfigurationManagement.ReadModelDesign); } else { _node = ProjectTreeNode.CreateNewModel(HomeDirectory); } Add(_node); }
public void AddProject(bool existing) { ProjectTreeNode _node = null; if (existing) { string _DefaultFileName = Path.Combine(HomeDirectory, Resources.DefaultProjectName); _node = ProjectTreeNode.ImportNodeSet(this, x => AssemblyTraceEvent.Tracer.TraceEvent(x.TraceLevel, 186, x.ToString()), OPCFModelConfigurationManagement.ReadModelDesign); } else { _node = ProjectTreeNode.CreateNewModel(this); } Add(_node); }