/// <summary>
        /// Clones this instance.
        /// </summary>
        /// <returns>
        /// The clone.
        /// </returns>
        public override ExpressionObjectBase Clone()
        {
            var clone = new SetChecklistDataExpression();
            CopyMembers(clone);

            return clone;
        }
        public void Clone_Returns_SetChecklistDataExpression()
        {
            // Arrange.
            var expression = new SetChecklistDataExpression();

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

            // Assert.
            Assert.IsNotNull(clone);
            Assert.AreEqual(ExpressionNodeType.SetChecklistData, clone.Type);
        }
        public void WhenInputConnectorIsConnected_SecondOutputConnectorDataTypeIsUpdated()
        {
            // Arrange.
            var expression = new SetChecklistDataExpression();
            var source = new ConstantExpression { ConnectorOut = { ElementType = NodeDataType.Boolean } };

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

            // Assert.
            Assert.AreEqual(NodeDataType.Boolean, expression.Connector2Out.DataType);

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

            // Assert.
            Assert.AreEqual(NodeDataType.Object, expression.Connector2Out.DataType);
        }
        public void ToExpressionNode_SetChecklistData_Test()
        {
            // Arrange.
            var nodeFactory = new ExpressionNodeFactory();
            var connection1 = new Connection();
            connection1.Source = new ConnectorOut(connection1);
            connection1.Sink = new ConnectorIn(connection1);

            var connection2 = new Connection();
            connection2.Source = new ConnectorOut(connection2);
            connection2.Sink = new ConnectorIn(connection2);

            var connection3 = new Connection();
            connection3.Source = new ConnectorOut(connection3);
            connection3.Sink = new ConnectorIn(connection3);

            var destination = new DestinationFieldList { UniqueName = "Destination" };
            destination.Fields.Add(new DestinationField(destination));
            destination.Fields.Add(new DestinationField(destination));
            var source = new SourceFieldList();
            source.Fields.Add(new SourceField(source) { Name = "Field" });

            var func = new SetChecklistDataExpression { UniqueName = "Function" };

            func.ConnectorIn.Id = connection1.Sink.Id;
            source.Fields[0].ConnectorOut.Id = connection1.Source.Id;

            destination.Fields[0].ConnectorIn.Id = connection2.Sink.Id;
            func.Connector1Out.Id = connection2.Source.Id;

            destination.Fields[1].ConnectorIn.Id = connection3.Sink.Id;
            func.Connector2Out.Id = connection3.Source.Id;

            var objects = new List<IExpressionObjectBase> { source, destination, func, connection1, connection2, connection3 };

            // Act.
            var destNode = nodeFactory.CreateExpressionNodes(objects);

            // Assert.
            Assert.IsTrue(destNode.ResultNodes.ElementAt(0).Expression is SetChecklistDataFunctionNode);
            Assert.IsTrue(destNode.ResultNodes.ElementAt(1).Expression is GetContextValueFunctionNode);
        }