public void Copy_For_Nodes_Throws_If_targetAttribs_Is_Null()
        {
            //Arrange
            var copier = new DataAttributeTableCopier();
            var mockNodeData = new Mock<IDataAttributes<INode>>();

            //Act, Assert
            var ex = Assert.Throws<ArgumentNullException>(() => copier.Copy( mockNodeData.Object, null));
        }
        public void Copy_For_Nodes_For_Empty_Network(int numNodes, int numEdges, bool isDirected, bool selfLoops, bool multiEdges, int[] intVals, double[] doubleVals, bool[] boolVals, string[] stringVals)
        {
            //Arrange
            var copier = new DataAttributeTableCopier();

            #region Create src and target networks

            IBasicAdjList src = BasicAdjListGenerator.GenerateAdjListWithDataAttribs(numNodes, numEdges, isDirected, true, false);
            var builder = new DataAttributesBuilder();
            var colIndex = builder.AddColumn((INodeAttributes)src, typeof(int));
            builder.PopulateCol<int, INode>(src.NodeData, colIndex, intVals);
            colIndex = builder.AddColumn((INodeAttributes)src, typeof(double));
            builder.PopulateCol<double, INode>(src.NodeData, colIndex, doubleVals);
            colIndex = builder.AddColumn((INodeAttributes)src, typeof(bool));
            builder.PopulateCol<bool, INode>(src.NodeData, colIndex, boolVals);
            colIndex = builder.AddColumn((INodeAttributes)src, typeof(string));
            builder.PopulateCol<string, INode>(src.NodeData, colIndex, stringVals);

            // create a copy of src network and enable node data attribs
            IBasicAdjList targ = new BasicAdjList(Guid.NewGuid(), isDirected);
            foreach (var srcNode in src.Nodes)
            {
                targ.CreateNode();
            }
            INode a;
            INode b;
            foreach (var srcEdge in src.Edges)
            {
                a = targ.Nodes[srcEdge.SourceNode.Index];
                b = targ.Nodes[srcEdge.DestinationNode.Index];
                targ.CreateEdge(a, b);
            }
            using (var fac = new DataAttributeTableFactory(targ))
            {
                fac.CreateNodeDataTable();
            }

            #endregion

            //Act
            copier.Copy(src.NodeData, targ.NodeData);

            //Assert
            Assert.NotNull(targ.NodeData);
            Assert.Equal(src.NodeData.ColumnCount, targ.NodeData.ColumnCount);
            Assert.Equal(numNodes, targ.NodeData.RowCount);

            for (int i = 0; i < targ.NodeDataAttributeCount; i++)
            {
                Assert.Equal(src.NodeData.DataTypes[i], targ.NodeData.DataTypes[i]);
                Assert.Equal(src.NodeData.ColumnNames[i], targ.NodeData.ColumnNames[i]);
                Assert.Equal(src.NodeData.ColumnDefaultValues[i], targ.NodeData.ColumnDefaultValues[i]);
            }
        }
        public void Copy_For_Nodes_Throws_If_Params_Are_Same()
        {
            //Arrange
            var copier = new DataAttributeTableCopier();
            var mockSrcNodeData = new Mock<IDataAttributes<INode>>();
            var mockTargNodeData = mockSrcNodeData;

            //Act, Assert
            var ex = Assert.Throws<ArgumentException>(() => copier.Copy(mockSrcNodeData.Object, mockTargNodeData.Object));
        }
        public void Copy_For_Edges_Throws_If_srcAttribs_Is_Null()
        {
            //Arrange
            var copier = new DataAttributeTableCopier();
            var mockEdgeData = new Mock<IDataAttributes<IEdge>>();

            //Act, Assert
            var ex = Assert.Throws<ArgumentNullException>(() => copier.Copy(null, mockEdgeData.Object));
        }