Ejemplo n.º 1
0
        public void TestAddTerminalViewModel_TerminalModelAddedToNodeModel()
        {
            var testPluginNode       = new TestPluginNode();
            var terminalMoq          = new Mock <TerminalModel>("", typeof(int), Direction.North, TerminalKind.Output, 0);
            var terminalViewModelMoq = new Mock <OutputTerminal>(terminalMoq.Object);

            terminalViewModelMoq.SetupGet(n => n.Model).Returns(terminalMoq.Object);
            var nodeMoq = new Mock <NodeModel>("");

            testPluginNode.Model = nodeMoq.Object;

            testPluginNode.AddTerminalViewModel(terminalViewModelMoq.Object);

            nodeMoq.Verify(n => n.AddTerminal(terminalMoq.Object));
        }
Ejemplo n.º 2
0
        public void TestAddTerminalViewModel_TerminalViewModelAddedToTerminalViewModels()
        {
            var testPluginNode       = new TestPluginNode();
            var terminalMoq          = new Mock <TerminalModel>("", typeof(int), Direction.North, TerminalKind.Output, 0);
            var terminalViewModelMoq = new Mock <OutputTerminal>(terminalMoq.Object);

            terminalViewModelMoq.SetupGet(n => n.Model).Returns(terminalMoq.Object);
            var nodeMoq = new Mock <NodeModel>("");

            testPluginNode.Model = nodeMoq.Object;

            testPluginNode.AddTerminalViewModel(terminalViewModelMoq.Object);

            Assert.AreEqual(terminalViewModelMoq.Object, testPluginNode.Terminals.First());
        }