コード例 #1
0
        public void TestException()
        {
            Assert.Throws <ArgumentNullException>(() => new GetNextRequestPdu(null));
            Assert.Throws <ArgumentNullException>(() => new GetNextRequestPdu(0, null));

            var pdu = new GetNextRequestPdu(0, ErrorCode.NoError, 0, new List <Variable>());

            Assert.Throws <ArgumentNullException>(() => pdu.AppendBytesTo(null));
            Assert.AreEqual("GET NEXT request PDU: seq: 0; status: 0; index: 0; variable count: 0", pdu.ToString());
        }
コード例 #2
0
        public void TestException()
        {
            Assert.Throws <ArgumentNullException>(() => new GetNextRequestPdu(new Tuple <int, byte[]>(0, new byte[] { 0 }), null));
            Assert.Throws <ArgumentNullException>(() => new GetNextRequestPdu(0, null));

            var pdu = new GetNextRequestPdu(0, new List <Variable>());

            Assert.Throws <ArgumentNullException>(() => pdu.AppendBytesTo(null));
            Assert.Equal("GET NEXT request PDU: seq: 0; status: 0; index: 0; variable count: 0", pdu.ToString());
        }
コード例 #3
0
        public void TestException()
        {
            Assert.Throws<ArgumentNullException>(() => new GetNextRequestPdu(new Tuple<int, byte[]>(0, new byte[] { 0 }), null));
            Assert.Throws<ArgumentNullException>(() => new GetNextRequestPdu(0, null));
            
            var pdu = new GetNextRequestPdu(0, ErrorCode.NoError, 0, new List<Variable>());
            Assert.Throws<ArgumentNullException>(() => pdu.AppendBytesTo(null));
            Assert.AreEqual("GET NEXT request PDU: seq: 0; status: 0; index: 0; variable count: 0", pdu.ToString());

        }