Esempio n. 1
0
        public void Set_ErrorCode_after_disposed()
        {
            Ack2Packet packet = new Ack2Packet();
            packet.Dispose();

            Assert.Throws<ObjectDisposedException>(() => packet.SequenceNumber = 1);
        }
Esempio n. 2
0
        public void Set_ErrorCode_after_disposed()
        {
            Ack2Packet packet = new Ack2Packet();

            packet.Dispose();

            Assert.Throws <ObjectDisposedException>(() => packet.SequenceNumber = 1);
        }
Esempio n. 3
0
        public void ErrorCode()
        {
            Ack2Packet packet = new Ack2Packet();

            foreach (int value in new[] { 1, Int32.MaxValue, -1, Int32.MinValue, 0 })
            {
                packet.SequenceNumber = value;
                Assert.AreEqual(value, packet.SequenceNumber);
            }

            packet.Dispose();
        }
Esempio n. 4
0
        public void ErrorCode()
        {
            Ack2Packet packet = new Ack2Packet();

            foreach (int value in new[] { 1, Int32.MaxValue, -1, Int32.MinValue, 0 })
            {
                packet.SequenceNumber = value;
                Assert.AreEqual(value, packet.SequenceNumber);
            }

            packet.Dispose();
        }
Esempio n. 5
0
        public void Create_and_dispose()
        {
            Ack2Packet packet = new Ack2Packet();

            Assert.AreEqual(0, packet.DestinationId);
            Assert.AreEqual(0, packet.SequenceNumber);
            Assert.IsFalse(packet.IsDisposed);
            Assert.IsTrue(packet.IsEditable);
            Assert.AreEqual(TimeSpan.Zero, packet.TimeStamp);

            packet.Dispose();

            Assert.Throws<ObjectDisposedException>(() => { var x = packet.DestinationId; });
            Assert.Throws<ObjectDisposedException>(() => { var x = packet.SequenceNumber; });
            Assert.IsTrue(packet.IsDisposed);
            Assert.IsFalse(packet.IsEditable);
            Assert.Throws<ObjectDisposedException>(() => { var x = packet.TimeStamp; });
        }
Esempio n. 6
0
        public void Create_and_dispose()
        {
            Ack2Packet packet = new Ack2Packet();

            Assert.AreEqual(0, packet.DestinationId);
            Assert.AreEqual(0, packet.SequenceNumber);
            Assert.IsFalse(packet.IsDisposed);
            Assert.IsTrue(packet.IsEditable);
            Assert.AreEqual(TimeSpan.Zero, packet.TimeStamp);

            packet.Dispose();

            Assert.Throws <ObjectDisposedException>(() => { var x = packet.DestinationId; });
            Assert.Throws <ObjectDisposedException>(() => { var x = packet.SequenceNumber; });
            Assert.IsTrue(packet.IsDisposed);
            Assert.IsFalse(packet.IsEditable);
            Assert.Throws <ObjectDisposedException>(() => { var x = packet.TimeStamp; });
        }