public void Connect_Connected( )
        {
            var iface = new SUTest(fakeDevice, "eth1");

            var otherFakeDevice = new Abstract.Fakes.StubINetDevice( );
            var iface2 = new SUTest(otherFakeDevice, "eth1");

            iface.Connect(iface2);
            iface.Connect(iface2);
        }
Ejemplo n.º 2
0
        public void Connect_Connected( )
        {
            var iface = new SUTest(fakeDevice, "eth1");

            var otherFakeDevice = new Abstract.Fakes.StubINetDevice( );
            var iface2          = new SUTest(otherFakeDevice, "eth1");

            iface.Connect(iface2);
            iface.Connect(iface2);
        }
Ejemplo n.º 3
0
        public void Connect_ReConnected( )
        {
            var iface = new SUTest(fakeDevice, "eth1");

            #region Disconnect
            var otherFakeDevice = new Abstract.Fakes.StubINetDevice( );
            var iface2          = new SUTest(otherFakeDevice, "eth1");
            iface.Connect(iface2);
            iface.Disconnect( );
            #endregion

            iface.Connect(iface2);

            Assert.AreEqual(iface2, iface.GetOtherInterface( ));
            Assert.AreEqual(iface, iface2.GetOtherInterface( ));
        }
        public void Connect_Other( )
        {
            var iface = new SUTest(fakeDevice, "eth1");
            var iface2 = new SUTest(fakeDevice, "eth2");
            iface.Connect(iface2);

            Assert.AreEqual(iface2, iface.GetOtherInterface( ));
            Assert.AreEqual(iface, iface2.GetOtherInterface( ));
        }
Ejemplo n.º 5
0
        public void Connect_Other( )
        {
            var iface  = new SUTest(fakeDevice, "eth1");
            var iface2 = new SUTest(fakeDevice, "eth2");

            iface.Connect(iface2);

            Assert.AreEqual(iface2, iface.GetOtherInterface( ));
            Assert.AreEqual(iface, iface2.GetOtherInterface( ));
        }
Ejemplo n.º 6
0
        public void Connect_OtherFromOtherDevice_OtherName( )
        {
            var iface = new SUTest(fakeDevice, "eth1");

            var otherFakeDevice = new Abstract.Fakes.StubINetDevice( );
            var iface2          = new SUTest(otherFakeDevice, "eth2");

            iface.Connect(iface2);

            Assert.AreEqual(iface2, iface.GetOtherInterface( ));
            Assert.AreEqual(iface, iface2.GetOtherInterface( ));
        }
        public void Connect_OtherFromOtherDevice_TheSameName( )
        {
            var iface = new SUTest(fakeDevice, "eth1");

            var otherFakeDevice = new Abstract.Fakes.StubINetDevice( );
            var iface2 = new SUTest(otherFakeDevice, "eth1");

            iface.Connect(iface2);

            Assert.AreEqual(iface2, iface.GetOtherInterface( ));
            Assert.AreEqual(iface, iface2.GetOtherInterface( ));
        }
Ejemplo n.º 8
0
        public void SendData( )
        {
            using (ShimsContext.Create( )) {
                var iface = new SUTest(fakeDevice, "eth1");

                var             sended      = false;
                INetPacket      fakePacket  = new Abstract.Fakes.StubINetPacket( );
                INetDevice      otherDevice = new Abstract.Fakes.StubINetDevice( );
                INetHwInterface otherIface  = new SUTest(otherDevice, "eth1");
                Simulator.Fakes.ShimNetHwInterface.AllInstances.ReceiveDataINetPacket =
                    (SUTest instance, INetPacket iNetPacket) => {
                    Assert.AreEqual(iface.HardwareAddress, iNetPacket.SourceHardwareAddress);
                    Assert.AreEqual(otherIface.HardwareAddress, iNetPacket.DestinationHardwareAddress);
                    Assert.AreEqual(fakePacket.SourceAddress, iNetPacket.SourceAddress);
                    Assert.AreEqual(fakePacket.DestinationAddress, iNetPacket.DestinationAddress);
                    sended = true;
                };
                iface.Connect(otherIface);

                iface.SendData(fakePacket);

                Assert.IsTrue(sended);
            }
        }
Ejemplo n.º 9
0
        public void Connect_TheSame( )
        {
            var iface = new SUTest(fakeDevice, "eth1");

            iface.Connect(iface);
        }
Ejemplo n.º 10
0
        public void Connect_Null( )
        {
            var iface = new SUTest(fakeDevice, "eth1");

            iface.Connect(null);
        }
        public void Connect_ReConnected( )
        {
            var iface = new SUTest(fakeDevice, "eth1");

            #region Disconnect
            var otherFakeDevice = new Abstract.Fakes.StubINetDevice( );
            var iface2 = new SUTest(otherFakeDevice, "eth1");
            iface.Connect(iface2);
            iface.Disconnect( );
            #endregion

            iface.Connect(iface2);

            Assert.AreEqual(iface2, iface.GetOtherInterface( ));
            Assert.AreEqual(iface, iface2.GetOtherInterface( ));
        }
 public void Connect_Null( )
 {
     var iface = new SUTest(fakeDevice, "eth1");
     iface.Connect(null);
 }
        public void SendData( )
        {
            using (ShimsContext.Create( )) {
                var iface = new SUTest(fakeDevice, "eth1");

                var sended = false;
                INetPacket fakePacket = new Abstract.Fakes.StubINetPacket( );
                INetDevice otherDevice = new Abstract.Fakes.StubINetDevice( );
                INetHwInterface otherIface = new SUTest(otherDevice, "eth1");
                Simulator.Fakes.ShimNetHwInterface.AllInstances.ReceiveDataINetPacket =
                    (SUTest instance, INetPacket iNetPacket) => {
                        Assert.AreEqual(iface.HardwareAddress, iNetPacket.SourceHardwareAddress);
                        Assert.AreEqual(otherIface.HardwareAddress, iNetPacket.DestinationHardwareAddress);
                        Assert.AreEqual(fakePacket.SourceAddress, iNetPacket.SourceAddress);
                        Assert.AreEqual(fakePacket.DestinationAddress, iNetPacket.DestinationAddress);
                        sended = true;
                    };
                iface.Connect(otherIface);

                iface.SendData(fakePacket);

                Assert.IsTrue(sended);
            }
        }
 public void Connect_TheSame( )
 {
     var iface = new SUTest(fakeDevice, "eth1");
     iface.Connect(iface);
 }