예제 #1
0
 public void TestException()
 {
     Assert.Throws<ArgumentNullException>(() => new SetRequestPdu(new Tuple<int, byte[]>(0, new byte[] { 0 }), null));
     Assert.Throws<ArgumentNullException>(() => new SetRequestPdu(0, null));
     
     var pdu = new SetRequestPdu(0, ErrorCode.NoError, 0, new List<Variable>());
     Assert.Throws<ArgumentNullException>(() => pdu.AppendBytesTo(null));
     Assert.AreEqual("SET request PDU: seq: 0; status: 0; index: 0; variable count: 0", pdu.ToString());
 }
        public void TestException()
        {
            Assert.Throws <ArgumentNullException>(() => new SetRequestPdu(null));
            Assert.Throws <ArgumentNullException>(() => new SetRequestPdu(0, null));

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

            Assert.Throws <ArgumentNullException>(() => pdu.AppendBytesTo(null));
            Assert.AreEqual("SET request PDU: seq: 0; status: 0; index: 0; variable count: 0", pdu.ToString());
        }
예제 #3
0
        public void TestException()
        {
            Assert.Throws <ArgumentNullException>(() => new SetRequestPdu(new Tuple <int, byte[]>(0, new byte[] { 0 }), null));
            Assert.Throws <ArgumentNullException>(() => new SetRequestPdu(0, null));

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

            Assert.Throws <ArgumentNullException>(() => pdu.AppendBytesTo(null));
            Assert.Equal("SET request PDU: seq: 0; status: 0; index: 0; variable count: 0", pdu.ToString());
        }