Beispiel #1
0
 public MessageRouterTests()
 {
     _route1 = new Mock <NmeaSinkAndSource>(MockBehavior.Strict, "1");
     _route2 = new Mock <NmeaSinkAndSource>(MockBehavior.Strict, "2");
     _router = new MessageRouter();
     _router.AddEndPoint(_route1.Object);
     _router.AddEndPoint(_route2.Object);
 }
Beispiel #2
0
        public void RoutingCanBeConstructed()
        {
            var           route1 = new Mock <NmeaSinkAndSource>(MockBehavior.Strict, "1");
            var           route2 = new Mock <NmeaSinkAndSource>(MockBehavior.Strict, "2");
            MessageRouter mr     = new MessageRouter();

            Assert.Equal(2, mr.EndPoints.Count); // Already has the default internal end point and the logger
            mr.AddEndPoint(route1.Object);
            mr.AddEndPoint(route2.Object);
            Assert.Equal(4, mr.EndPoints.Count);
        }