Ejemplo n.º 1
0
        /// <summary>
        /// Clones this instance.
        /// </summary>
        /// <returns>
        /// The clone.
        /// </returns>
        public override ExpressionObjectBase Clone()
        {
            var clone = new TakeItemsExpression();
            CopyMembers(clone);

            return clone;
        }
Ejemplo n.º 2
0
        public void Clone_Returns_TakeItemsExpression()
        {
            // Arrange.
            var expression = new TakeItemsExpression();

            // Act.
            var clone = expression.Clone() as TakeItemsExpression;

            // Assert.
            Assert.IsNotNull(clone);
            Assert.AreEqual(ExpressionNodeType.TakeItems, clone.Type);
        }
Ejemplo n.º 3
0
        public void WhenFirstInputConnectorIsConnected_OutputConnectorElementTypeIsUpdated()
        {
            // Arrange.
            var expression = new TakeItemsExpression();
            var source = new ConstantExpression { ConnectorOut = { ElementType = NodeDataType.Decimal } };

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

            // Assert.
            Assert.AreEqual(NodeDataType.Decimal, expression.ConnectorOut.ElementType);

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

            // Assert.
            Assert.AreEqual(NodeDataType.Object, expression.ConnectorOut.ElementType);
        }