Ejemplo n.º 1
0
        public void Copy_Throws_If_InputNetwork_Is_Incorrect_Type()
        {
            //Arrange
            var copier = new BasicAdjListCopier();
            INetwork src = new DummyMatrix();

            var ex = Assert.Throws<ArgumentException>(() => copier.Copy(src));
        }
Ejemplo n.º 2
0
        public void Copy_Throws_If_InputNetwork_Is_Null()
        {
            //Arrange
            var copier = new BasicAdjListCopier();
            INetwork src = null;

            var ex = Assert.Throws<ArgumentNullException>(() => copier.Copy(src));
        }
Ejemplo n.º 3
0
        public void Copy_And_Exclude_Data_Attributes(int nodeCount, int edgeCount, bool directed)
        {
            //Arrange
            var copier = new BasicAdjListCopier();
            IBasicAdjList src = BasicAdjListGenerator.GenerateAdjList(nodeCount, edgeCount, directed);

            //Act
            IBasicAdjList net = copier.Copy(src) as IBasicAdjList;

            //Assert
            Assert.NotNull(net);
            Assert.Equal(net.NodeCount, src.NodeCount);
            Assert.Equal(net.Nodes.Count, src.NodeCount);
            Assert.Equal(net.EdgeCount, src.EdgeCount);
            Assert.Equal(net.Edges.Count, src.EdgeCount);
            Assert.Equal(net.IsDirected, src.IsDirected);
            Assert.Equal(net.Name, src.Name);
            Assert.NotEqual(net.Id, src.Id);
            Assert.Equal(src.NodeAttributeCount, src.NodeAttributeCount);
            Assert.Equal(src.EdgeAttributeCount, src.EdgeAttributeCount);
        }