public void ParseWellFormed() { var eom = new EndOfMibView(); var result = eom.Decode(EoMPacket, 0); Assert.Equal(2, result); Assert.Equal(SnmpConstants.SmiEndOfMIBView, eom.Type); }
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); }
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()); }
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()); }
public void TestToString() { var eom = new EndOfMibView(); Assert.Equal("SNMP End-of-MIB-View", eom.ToString()); }
public void ParsePoorlyFormedPadding() { var eom = new EndOfMibView(); Assert.Throws <SnmpSharpNet.Exception.SnmpException>(() => { eom.Decode(BadEoMPacketPadding, 0); }); }
public void TestToBytes() { EndOfMibView obj = new EndOfMibView(); Assert.AreEqual(new byte[] { 0x82, 0x00 }, obj.ToBytes()); }