コード例 #1
0
        public void ParseWellFormed()
        {
            var eom    = new EndOfMibView();
            var result = eom.Decode(EoMPacket, 0);

            Assert.Equal(2, result);
            Assert.Equal(SnmpConstants.SmiEndOfMIBView, eom.Type);
        }
コード例 #2
0
        public void Constructors()
        {
            var eom = new EndOfMibView();

            Assert.NotNull(eom);
            Assert.Equal(SnmpConstants.SmiEndOfMIBView, eom.Type);

            var copy = new EndOfMibView(eom);

            Assert.Equal(SnmpConstants.SmiEndOfMIBView, copy.Type);

            var clone = (EndOfMibView)copy.Clone();

            Assert.Equal(SnmpConstants.SmiEndOfMIBView, clone.Type);
        }
コード例 #3
0
		public void TestToBytes()
		{
			EndOfMibView obj = new EndOfMibView();
			Assert.AreEqual(new byte[] { 0x82, 0x00 }, obj.ToBytes());
            Assert.AreEqual(0, obj.GetHashCode());

            EndOfMibView right = new EndOfMibView();
            Assert.AreEqual(obj, right);
            Assert.IsTrue(obj.Equals(right));
            Assert.IsTrue(obj != null);
// ReSharper disable EqualExpressionComparison
            Assert.IsTrue(obj == obj);
// ReSharper restore EqualExpressionComparison

		    Assert.Throws<ArgumentNullException>(() => obj.AppendBytesTo(null));
            Assert.AreEqual("EndOfMibView", obj.ToString());
		}
コード例 #4
0
        public void TestToBytes()
        {
            EndOfMibView obj = new EndOfMibView();

            Assert.Equal(new byte[] { 0x82, 0x00 }, obj.ToBytes());
            Assert.Equal(0, obj.GetHashCode());

            EndOfMibView right = new EndOfMibView();

            Assert.Equal(obj, right);
            Assert.True(obj.Equals(right));
            Assert.True(obj != null);
// ReSharper disable EqualExpressionComparison
            Assert.True(obj == obj);
// ReSharper restore EqualExpressionComparison

            Assert.Throws <ArgumentNullException>(() => obj.AppendBytesTo(null));
            Assert.Equal("EndOfMibView", obj.ToString());
        }
コード例 #5
0
        public void TestToString()
        {
            var eom = new EndOfMibView();

            Assert.Equal("SNMP End-of-MIB-View", eom.ToString());
        }
コード例 #6
0
        public void ParsePoorlyFormedPadding()
        {
            var eom = new EndOfMibView();

            Assert.Throws <SnmpSharpNet.Exception.SnmpException>(() => { eom.Decode(BadEoMPacketPadding, 0); });
        }
コード例 #7
0
		public void TestToBytes()
		{
			EndOfMibView obj = new EndOfMibView();
			Assert.AreEqual(new byte[] { 0x82, 0x00 }, obj.ToBytes());
		}
コード例 #8
0
        public void TestToBytes()
        {
            EndOfMibView obj = new EndOfMibView();

            Assert.AreEqual(new byte[] { 0x82, 0x00 }, obj.ToBytes());
        }