예제 #1
0
        public void ReadArcString_Reads_Directed_Edge_And_Maps_Weight_When_Present(string inputStr, double expectedWeight)
        {
            //Arrange
            bool result = false;
            int srcV = -1;
            int targV = -1;
            double weight = double.NaN;

            NetFileReader reader = new NetFileReader();

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

            //Assert
            Assert.Equal(expectedWeight, weight);
            if (weight == expectedWeight)
            {
                Assert.True(result);
            }
        }
예제 #2
0
        public void ReadArcString_Returns_False_For_Invalid_Input(string inputStr, int expectedSrcVtxNum, int expectedTargVtxNum)
        {
            //Arrange
            bool result = false;
            int srcV = -1;
            int targV = -1;
            double weight = double.NaN;

            NetFileReader reader = new NetFileReader();

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

            //Assert
            Assert.False(result);
            Assert.Equal(expectedSrcVtxNum, srcV);
            Assert.Equal(expectedTargVtxNum, targV);
        }
예제 #3
0
        public void ReadArcString_Reads_Directed_Edge_And_Vertex_Numbers(string inputStr, int expectedSrcVtxNum, int expectedTargVtxNum)
        {
            //Arrange
            bool result = false;
            int srcV = -1;
            int targV = -1;
            double weight = double.NaN;

            NetFileReader reader = new NetFileReader();

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

            //Assert
            Assert.Equal(expectedSrcVtxNum, srcV);
            Assert.Equal(expectedTargVtxNum, targV);
            if (srcV == expectedSrcVtxNum && targV == expectedTargVtxNum)
            {
                Assert.True(result);
            }
        }