public void TestNodeSearchElement() { //Arrange string path = Path.Combine(TestDirectory, @"core\CustomNodes\CNDefault.dyf"); const string nodeName = "TheNoodle"; const string catName = "TheCat"; const string descr = "TheCat"; var guid1 = Guid.NewGuid(); var dummyInfo1 = new CustomNodeInfo(guid1, nodeName, catName, descr, path); var moq = new Mock <ICustomNodeSource>(); var dummySearch1 = new CustomNodeSearchElementTest2(moq.Object, dummyInfo1); //Act //Execute the GenerateInputParameters() method List <Tuple <string, string> > inputParameters = dummySearch1.InputParameters as List <Tuple <string, string> >; //Execute the GenerateOutputParameters() method List <string> outputParameters = dummySearch1.OutputParameters as List <string>; dummySearch1.ProduceNode(); //Assert //It just validates that the parameters is not null and has at least one element in the list Assert.IsNotNull(inputParameters); Assert.Greater(inputParameters.Count, 0); Assert.IsNotNull(outputParameters); Assert.Greater(outputParameters.Count, 0); //This will execute the Get of the IsVisibleInSearch property Assert.IsTrue(dummySearch1.IsVisibleInSearch); }
public void TestDragDropNodeSearchElement() { //Arrange string path = Path.Combine(TestDirectory, @"core\CustomNodes\CNDefault.dyf"); const string nodeName = "TheNoodle"; const string catName = "TheCat"; const string descr = "TheCat"; var guid1 = Guid.NewGuid(); var dummyInfo1 = new CustomNodeInfo(guid1, nodeName, catName, descr, path); var moq = new Mock <ICustomNodeSource>(); var dummySearch1 = new CustomNodeSearchElementTest2(moq.Object, dummyInfo1); //Act //This will execute the DragDropNodeSearchElementInfo constructor var dragAndDropElement = new DragDropNodeSearchElementInfo(dummySearch1); //Assert //This will execute the Get method of the SearchElement property Assert.IsNotNull(dragAndDropElement.SearchElement); }