예제 #1
0
        public void DependencyOf_ExistinIndexes2_ShouldReturnDependency()
        {
            double[][] matrix =
            {
                new double[] { 0, 1, 1 },
                new double[] { 1, 0, 1 },
                new double[] { 1, 1, 0 }
            };

            var network = new Network(matrix);

            var alg = new DependencyAlgorithm(network);

            Assert.Equal(0.75, alg.DependencyOf(0, 1));
        }
예제 #2
0
        public void GetDependencyMatrix_BeforeExecution_ShouldThrow()
        {
            double[][] matrix =
            {
                new double[] { 0, 1, 0 },
                new double[] { 1, 0, 1 },
                new double[] { 0, 1, 0 }
            };

            var network = new Network(matrix);

            var alg = new DependencyAlgorithm(network);

            Assert.Throws <AlgorithmNotExecuted>(() => alg.GetDependencyMatrix());
        }
예제 #3
0
        public void GetDependencyMatrix_AfterExecution_ShouldReturnMatrixDameSizaAsInput()
        {
            double[][] matrix =
            {
                new double[] { 0, 1, 0 },
                new double[] { 1, 0, 1 },
                new double[] { 0, 1, 0 }
            };

            var network = new Network(matrix);

            var alg = new DependencyAlgorithm(network);

            alg.Execute();

            Assert.Equal(3, alg.GetDependencyMatrix().Length);
        }