コード例 #1
0
        /// <summary>
        /// Clones this instance.
        /// </summary>
        /// <returns>
        /// The clone.
        /// </returns>
        public override ExpressionObjectBase Clone()
        {
            var clone = new GetArrayItemExpression();
            CopyMembers(clone);

            return clone;
        }
コード例 #2
0
        public void Clone_Returns_GetArrayItemExpression()
        {
            // Arrange.
            const string ExpressionName = "Test Expression";
            const string FunctionName = "Test Function";
            const double Left = 100.0;
            const double Top = 200.0;
            const double Width = 300.0;
            const double Height = 400.0;

            var functionExpression = new GetArrayItemExpression
                                         {
                                             ExpressionName = ExpressionName,
                                             FunctionName = FunctionName,
                                             Left = Left,
                                             Top = Top,
                                             Width = Width,
                                             Height = Height
                                         };

            // Act.
            var clone = functionExpression.Clone() as GetArrayItemExpression;

            // Assert.
            Assert.IsNotNull(clone);
            Assert.AreEqual(ExpressionNodeType.GetArrayItem, clone.Type);
            Assert.AreEqual(ExpressionName, clone.ExpressionName);
            Assert.AreEqual(FunctionName, clone.FunctionName);
            Assert.AreEqual(Left, clone.Left);
            Assert.AreEqual(Top, clone.Top);
            Assert.AreEqual(Width, clone.Width);
            Assert.AreEqual(Height, clone.Height);
        }
コード例 #3
0
        public void WhenFirstInputConnectorIsConnected_OutputConnectorDataTypeIsUpdated()
        {
            // Arrange.
            var functionExpression = new GetArrayItemExpression();
            var source = new ConstantExpression { ConnectorOut = { ElementType = NodeDataType.DateTime } };

            // Act.
            functionExpression.Connector1In.ConnectedTo = source.ConnectorOut;

            // Assert.
            Assert.AreEqual(NodeDataType.DateTime, functionExpression.ConnectorOut.DataType);

            // Act.
            functionExpression.Connector1In.ConnectedTo = null;

            // Assert.
            Assert.AreEqual(NodeDataType.Object, functionExpression.ConnectorOut.DataType);
        }