예제 #1
0
 internal INetwork CopyInputNetwork(INetwork network)
 {
     INetwork copy = null;
     using (var provider = new NetworkToolProvider())
     {
         using (var copier = provider.GetCopier(network))
         {
             copier.CopyNodeData = copier.CopyEdgeData = true;
             copy = copier.CopyNetwork(network);
         }
     }
     return copy;
 }
예제 #2
0
        public void GetCopier_When_T_Is_IBasicAdjList()
        {
            //Arrange
            var provider = new NetworkToolProvider();

            //Act
            var copier = provider.GetCopier<IBasicAdjList>();

            //Assert
            Assert.NotNull(copier);
            Assert.IsType<BasicAdjListCopier>(copier);
        }
예제 #3
0
        public void GetCopier_When_Input_Is_IBasicAdjList()
        {
            //Arrange
            var mockNet = new Mock<IBasicAdjList>();
            var provider = new NetworkToolProvider();

            //Act
            var copier = provider.GetCopier(mockNet.Object);

            //Assert
            Assert.NotNull(copier);
            Assert.IsType<BasicAdjListCopier>(copier);
        }
예제 #4
0
        public void GetCopier_Throws_Ex_When_T_Is_ISymmetricMatrix()
        {
            //Arrange
            var provider = new NetworkToolProvider();

            //Act, Assert
            var ex = Assert.Throws<NotImplementedException>(() => provider.GetCopier<ISymmetricMatrix<double>>());
        }
예제 #5
0
        public void GetCopier_Throws_Ex_When_Input_Is_IFullMatrix()
        {
            //Arrange
            var mockNet = new Mock<IFullMatrix<double>>();
            var provider = new NetworkToolProvider();

            //Act, Assert
            var ex = Assert.Throws<NotImplementedException>(() => provider.GetCopier(mockNet.Object));
        }
예제 #6
0
        public void GetCopier_Returns_Null_When_Input_Is_INull()
        {
            //Arrange
            IBasicAdjList net = null;
            var provider = new NetworkToolProvider();

            //Act
            var copier = provider.GetCopier(net);

            //Assert
            Assert.Null(copier);
        }