Esempio n. 1
0
        public void ReadArcListString_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.ReadArcListString(inputStr, out srcV, out targV);

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

            NetFileReader reader = new NetFileReader();
            result = reader.ReadArcListString(inputStr, out srcV, out targV);

            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]);
            }
        }