Example #1
0
        public void ReadEdgeListString_Returns_False_For_Invalid_Input(string inputStr, int expectedSrcVtxNum)
        {
            //Arrange
            bool result = false;
            int srcV = -1;
            int[] targV = null;

            NetFileReader reader = new NetFileReader();

            //Act
            result = reader.ReadEdgeListString(inputStr, out srcV, out targV);

            //Assert
            Assert.False(result);
            Assert.Equal(expectedSrcVtxNum, srcV);
            Assert.NotNull(targV);
            Assert.Equal(0, targV.Length);
        }
Example #2
0
        public void ReadEdgeListString_Reads_Edge_From_Input_Including_Vertex_Numbers(string inputStr, int expectedSrcVtxNum, int [] expectedTargVtxNums)
        {
            //Arrange
            bool result = false;
            int srcV = -1;
            int [] targV = null;

            NetFileReader reader = new NetFileReader();

            //Act
            result = reader.ReadEdgeListString(inputStr, out srcV, out targV);

            //Assert
            Assert.True(result);
            Assert.Equal(expectedSrcVtxNum, srcV);
            Assert.NotNull(targV);
            Assert.Equal(expectedTargVtxNums.Length, targV.Length);

            for (int i = 0; i < targV.Length; i++)
            {
                Assert.Equal(expectedTargVtxNums[i], targV[i]);
            }
        }