示例#1
0
        public void TestHandoverEventActionCallHandover()
        {
            int dropped         = 0;
            int createdhandover = 0;
            int createdend      = 0;

            var data      = new CallData(1, 5, 20, 0);
            var tostation = new Station(1, 0, 10, 10);

            var fromstation = new Station(1, 0, 0, 10);

            fromstation.ClaimChannel(true);

            var e = new HandoverEvent(
                fromstation,
                tostation,
                () => { dropped++; },
                (d, cd) => { createdend++; },
                (d, cd) =>
            {
                createdhandover++;
                Assert.AreEqual(data, cd);
                Assert.AreEqual((uint)15, d);
            },
                5,
                data);

            e.Action();

            Assert.AreEqual(0, dropped);
            Assert.AreEqual(0, createdend);
            Assert.AreEqual(1, createdhandover);
        }
示例#2
0
        public void TestHandoverEventActionCallHandover()
        {
            int dropped = 0;
            int createdhandover = 0;
            int createdend = 0;

            var data = new CallData( 1, 5, 20, 0 );
            var tostation = new Station( 1, 0, 10, 10 );

            var fromstation = new Station( 1, 0, 0, 10 );
            fromstation.ClaimChannel( true );

            var e = new HandoverEvent(
                fromstation,
                tostation,
                () => { dropped++; },
                ( d, cd ) => { createdend++; },
                ( d, cd ) =>
                {
                    createdhandover++;
                    Assert.AreEqual( data, cd );
                    Assert.AreEqual( (uint) 15, d );
                },
                5,
                data );

            e.Action();

            Assert.AreEqual( 0, dropped );
            Assert.AreEqual( 0, createdend );
            Assert.AreEqual( 1, createdhandover );
        }