예제 #1
0
        public void AddCoverages()
        {
            var network = RouteHelperTest.GetSnakeNetwork(false, new Point(0, 0), new Point(100, 0),
                                                          new Point(100, 100));
            var location  = new NetworkLocation(network.Branches[0], 0);
            var coverageA = new NetworkCoverage {
                Network = network
            };
            var coverageB = new NetworkCoverage {
                Network = network
            };

            //add a uniform coverage B to a
            coverageB.DefaultValue = 100.0;

            coverageA[location] = 40.0;
            coverageA.Add(coverageB);

            Assert.AreEqual(140.0, coverageA[location]);

            //define a value for B so it no longer uses default value
            coverageB[location] = -20.0;

            //should substract the -20 now
            coverageA.Add(coverageB);
            Assert.AreEqual(120.0, coverageA[location]);
        }
예제 #2
0
        public void AddCoveragesThrowsExceptionIfNetworksDontMatch()
        {
            var coverageA = new NetworkCoverage {
                Network = new Network()
            };
            var coverageB = new NetworkCoverage {
                Network = new Network()
            };

            coverageA.Add(coverageB);
        }
        public void AddCoverages()
        {
            var network = RouteHelperTest.GetSnakeNetwork(false, new Point(0, 0), new Point(100, 0),
                                                               new Point(100, 100));
            var location = new NetworkLocation(network.Branches[0], 0);
            var coverageA = new NetworkCoverage { Network = network };
            var coverageB = new NetworkCoverage { Network = network };

            //add a uniform coverage B to a 
            coverageB.DefaultValue = 100.0;

            coverageA[location] = 40.0;
            coverageA.Add(coverageB);

            Assert.AreEqual(140.0,coverageA[location]);

            //define a value for B so it no longer uses default value
            coverageB[location] = -20.0;

            //should substract the -20 now
            coverageA.Add(coverageB);
            Assert.AreEqual(120.0,coverageA[location]);
        }