예제 #1
0
        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);
        }
예제 #2
0
        public void FindTest()
        {
            Mock <IProjectConfigurationManagement> _projectConfigurationMock = new Mock <IProjectConfigurationManagement>();
            Mock <OPCFModelDesign> _OPCFModelDesignMock = new Mock <OPCFModelDesign>();

            _projectConfigurationMock.SetupGet <OPCFModelDesign>(x => x.ModelDesign).Returns(_OPCFModelDesignMock.Object);
            _projectConfigurationMock.SetupGet <string>(x => x.Name).Returns("EFFF0C05 - 8406 - 4AD9 - 8725 - F00FC8295327");
            Mock <BaseTreeNode> _parentMock = new Mock <BaseTreeNode>("ParentBaseNode");

            _parentMock.SetupGet <string[]>(x => x.AvailiableNamespaces).Returns(new List <string>()
            {
                "ns1", "ns2"
            }.ToArray());
            ProjectTreeNode _newItem = new ProjectTreeNode(_projectConfigurationMock.Object)
            {
                Parent = _parentMock.Object
            };

            XmlQualifiedName _toFind     = new XmlQualifiedName("Name", "Namespace");
            ITypeDesign      _findReturn = _newItem.Find(_toFind);

            Assert.IsNull(_findReturn);
        }