Skip to content

Commit

Permalink
Fixed the failed test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
lextm committed Jul 30, 2024
1 parent 9ada1e9 commit b676c39
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Tests/CSharpCore/Unit/TrapV2PduTestFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ public void TestException()
Assert.Throws<ArgumentNullException>(() => new TrapV2Pdu(null, null));
Assert.Throws<ArgumentNullException>(() => new TrapV2Pdu(new Tuple<int, byte[]>(0, new byte[] { 0 }), null));
Assert.Throws<ArgumentNullException>(() => new TrapV2Pdu(0, null, 0, null));
Assert.Throws<ArgumentNullException>(() => new TrapV2Pdu(0, new ObjectIdentifier("1.3.6"), 0, null));
Assert.Throws<ArgumentNullException>(() => new TrapV2Pdu(0, new ObjectIdentifier("1.3.6"), 0, null));
var pdu = new TrapV2Pdu(0, new ObjectIdentifier("1.3"), 0, new List<Variable>());
Assert.Throws<NotSupportedException>(() => { var test = pdu.ErrorIndex; });
Assert.Throws<NotSupportedException>(() => { var test = pdu.ErrorStatus; });
Assert.Equal(Integer32.Zero, pdu.ErrorIndex);
Assert.Equal(Integer32.Zero, pdu.ErrorStatus);
Assert.Throws<ArgumentNullException>(() => pdu.AppendBytesTo(null));

Assert.Equal("TRAP v2 PDU: request ID: 0; enterprise: 1.3; time stamp: 00:00:00; variable count: 0", pdu.ToString());
}
}
Expand Down

0 comments on commit b676c39

Please sign in to comment.