Commit 7a662074 authored by Brickner_cp's avatar Brickner_cp

Code coverage 95.51%

Never accept derived exceptions when an expecting an expcetion in the tests.
parent 3b8d552a
......@@ -77,7 +77,7 @@ namespace PcapDotNet.Base.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentNullException))]
[ExpectedException(typeof(ArgumentNullException), AllowDerivedTypes = false)]
public void DictionaryEqualsNullTest()
{
Assert.IsFalse(new Dictionary<int, int>().DictionaryEquals(new Dictionary<int, int>(), null));
......
......@@ -73,6 +73,7 @@
<Compile Include="MemberInfoExtensionsTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="PropertyInfoExtensionsTests.cs" />
<Compile Include="SequenceTest.cs" />
<Compile Include="SerialNumber32Test.cs" />
<Compile Include="UInt128Tests.cs" />
<Compile Include="UInt24Tests.cs" />
......
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace PcapDotNet.Base.Test
{
/// <summary>
/// Summary description for SequenceTest
/// </summary>
[TestClass]
public class SequenceTest
{
/// <summary>
/// Gets or sets the test context which provides
/// information about and functionality for the current test run.
/// </summary>
public TestContext TestContext { get; set; }
#region Additional test attributes
//
// You can use the following additional attributes as you write your tests:
//
// Use ClassInitialize to run code before running the first test in the class
// [ClassInitialize()]
// public static void MyClassInitialize(TestContext testContext) { }
//
// Use ClassCleanup to run code after all tests in a class have run
// [ClassCleanup()]
// public static void MyClassCleanup() { }
//
// Use TestInitialize to run code before running each test
// [TestInitialize()]
// public void MyTestInitialize() { }
//
// Use TestCleanup to run code after each test has run
// [TestCleanup()]
// public void MyTestCleanup() { }
//
#endregion
[TestMethod]
[ExpectedException(typeof(ArgumentNullException), AllowDerivedTypes = false)]
public void GetHashCodeNullValue1Test()
{
Assert.IsNotNull(Sequence.GetHashCode(null, 1));
Assert.Fail();
}
[TestMethod]
[ExpectedException(typeof(ArgumentNullException), AllowDerivedTypes = false)]
public void GetHashCodeNullValue2Test()
{
Assert.IsNotNull(Sequence.GetHashCode(1, null));
Assert.Fail();
}
[TestMethod]
[ExpectedException(typeof(ArgumentNullException), AllowDerivedTypes = false)]
public void GetHashCodeNullValue3Test()
{
Assert.IsNotNull(Sequence.GetHashCode(1, 2, null));
Assert.Fail();
}
[TestMethod]
[ExpectedException(typeof(ArgumentNullException), AllowDerivedTypes = false)]
public void GetHashCodeNullValuesTest()
{
Assert.IsNotNull(Sequence.GetHashCode(null));
Assert.Fail();
}
}
}
\ No newline at end of file
......@@ -66,7 +66,7 @@ namespace PcapDotNet.Base.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentOutOfRangeException))]
[ExpectedException(typeof(ArgumentOutOfRangeException), AllowDerivedTypes = false)]
public void OverflowAddTest()
{
SerialNumber32 serialNumber = 1;
......
......@@ -80,7 +80,7 @@ namespace PcapDotNet.Base.Test
}
[TestMethod]
[ExpectedException(typeof(OverflowException))]
[ExpectedException(typeof(OverflowException), AllowDerivedTypes = false)]
public void CastToULongOverflow()
{
Random random = new Random();
......@@ -99,7 +99,7 @@ namespace PcapDotNet.Base.Test
}
[TestMethod]
[ExpectedException(typeof(OverflowException))]
[ExpectedException(typeof(OverflowException), AllowDerivedTypes = false)]
public void ParseOverflow()
{
Assert.AreEqual(0, UInt128.Parse("-1"));
......
......@@ -62,7 +62,7 @@ namespace PcapDotNet.Base.Test
}
[TestMethod]
[ExpectedException(typeof(OverflowException))]
[ExpectedException(typeof(OverflowException), AllowDerivedTypes = false)]
public void ParseTooBigTest()
{
UInt48 value = UInt48.Parse(ulong.MaxValue.ToString());
......@@ -70,7 +70,7 @@ namespace PcapDotNet.Base.Test
}
[TestMethod]
[ExpectedException(typeof(OverflowException))]
[ExpectedException(typeof(OverflowException), AllowDerivedTypes = false)]
public void ParseTooBigTestEvenForUInt64()
{
UInt48 value = UInt48.Parse(ulong.MaxValue + "0");
......
......@@ -333,7 +333,7 @@ namespace PcapDotNet.Core.Test
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
[ExpectedException(typeof(InvalidOperationException), AllowDerivedTypes = false)]
public void GetStatisticsOnCaptureModeErrorTest()
{
using (PacketCommunicator communicator = OpenLiveDevice())
......@@ -344,7 +344,7 @@ namespace PcapDotNet.Core.Test
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
[ExpectedException(typeof(InvalidOperationException), AllowDerivedTypes = false)]
public void GetPacketOnStatisticsModeErrorTest()
{
using (PacketCommunicator communicator = OpenLiveDevice())
......@@ -356,7 +356,7 @@ namespace PcapDotNet.Core.Test
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
[ExpectedException(typeof(InvalidOperationException), AllowDerivedTypes = false)]
public void SetInvalidModeErrorTest()
{
using (PacketCommunicator communicator = OpenLiveDevice())
......@@ -367,7 +367,7 @@ namespace PcapDotNet.Core.Test
// this test is removed for now since it doens't throw an exception for such big value
// [TestMethod]
// [ExpectedException(typeof(InvalidOperationException))]
// [ExpectedException(typeof(InvalidOperationException), AllowDerivedTypes = false)]
// public void SetBigKernelBufferSizeErrorTest()
// {
// using (PacketCommunicator communicator = OpenLiveDevice())
......@@ -377,7 +377,7 @@ namespace PcapDotNet.Core.Test
// }
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
[ExpectedException(typeof(InvalidOperationException), AllowDerivedTypes = false)]
public void SetSmallKernelBufferSizeGetPacketErrorTest()
{
const string SourceMac = "11:22:33:44:55:66";
......@@ -395,7 +395,7 @@ namespace PcapDotNet.Core.Test
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
[ExpectedException(typeof(InvalidOperationException), AllowDerivedTypes = false)]
public void SetSmallKernelBufferSizeGetSomePacketsErrorTest()
{
const string SourceMac = "11:22:33:44:55:66";
......@@ -414,7 +414,7 @@ namespace PcapDotNet.Core.Test
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
[ExpectedException(typeof(InvalidOperationException), AllowDerivedTypes = false)]
public void SetSmallKernelBufferSizeGetPacketsErrorTest()
{
const string SourceMac = "11:22:33:44:55:66";
......@@ -450,7 +450,7 @@ namespace PcapDotNet.Core.Test
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
[ExpectedException(typeof(InvalidOperationException), AllowDerivedTypes = false)]
public void SetSmallKernelBufferSizeGetNextStatisticsErrorTest()
{
using (PacketCommunicator communicator = OpenLiveDevice())
......@@ -465,7 +465,7 @@ namespace PcapDotNet.Core.Test
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
[ExpectedException(typeof(InvalidOperationException), AllowDerivedTypes = false)]
public void SetSmallKernelBufferSizeGetStatisticsErrorTest()
{
using (PacketCommunicator communicator = OpenLiveDevice())
......@@ -602,7 +602,7 @@ namespace PcapDotNet.Core.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentOutOfRangeException))]
[ExpectedException(typeof(ArgumentOutOfRangeException), AllowDerivedTypes = false)]
public void SetSamplingMethodOneEveryNErrorTest()
{
using (PacketCommunicator communicator = OpenLiveDevice())
......@@ -612,7 +612,7 @@ namespace PcapDotNet.Core.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentOutOfRangeException))]
[ExpectedException(typeof(ArgumentOutOfRangeException), AllowDerivedTypes = false)]
public void SetSamplingMethodFirstAfterIntervalNegativeMsErrorTest()
{
using (PacketCommunicator communicator = OpenLiveDevice())
......@@ -622,7 +622,7 @@ namespace PcapDotNet.Core.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentOutOfRangeException))]
[ExpectedException(typeof(ArgumentOutOfRangeException), AllowDerivedTypes = false)]
public void SetSamplingMethodFirstAfterIntervalNegativeTimespanErrorTest()
{
using (PacketCommunicator communicator = OpenLiveDevice())
......@@ -632,7 +632,7 @@ namespace PcapDotNet.Core.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentOutOfRangeException))]
[ExpectedException(typeof(ArgumentOutOfRangeException), AllowDerivedTypes = false)]
public void SetSamplingMethodFirstAfterIntervalBigTimespanErrorTest()
{
using (PacketCommunicator communicator = OpenLiveDevice())
......@@ -642,7 +642,7 @@ namespace PcapDotNet.Core.Test
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
[ExpectedException(typeof(InvalidOperationException), AllowDerivedTypes = false)]
public void SetInvalidDataLink()
{
using (PacketCommunicator communicator = OpenLiveDevice())
......
......@@ -114,7 +114,7 @@ namespace PcapDotNet.Core.Test
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
[ExpectedException(typeof(InvalidOperationException), AllowDerivedTypes = false)]
public void StatisticsModeErrorTest()
{
using (PacketCommunicator communicator = OpenOfflineDevice())
......@@ -137,7 +137,7 @@ namespace PcapDotNet.Core.Test
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
[ExpectedException(typeof(InvalidOperationException), AllowDerivedTypes = false)]
public void GetTotalStatisticsErrorTest()
{
using (PacketCommunicator communicator = OpenOfflineDevice())
......@@ -147,7 +147,7 @@ namespace PcapDotNet.Core.Test
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
[ExpectedException(typeof(InvalidOperationException), AllowDerivedTypes = false)]
public void OpenInvalidFileTest()
{
using (new OfflinePacketDevice("myinvalidfile").Open())
......@@ -157,7 +157,7 @@ namespace PcapDotNet.Core.Test
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
[ExpectedException(typeof(InvalidOperationException), AllowDerivedTypes = false)]
public void OpenNullFilenameTest()
{
using (new OfflinePacketDevice(null).Open())
......@@ -167,7 +167,7 @@ namespace PcapDotNet.Core.Test
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
[ExpectedException(typeof(InvalidOperationException), AllowDerivedTypes = false)]
public void SendPacketErrorTest()
{
using (PacketCommunicator communicator = OpenOfflineDevice())
......@@ -177,7 +177,7 @@ namespace PcapDotNet.Core.Test
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
[ExpectedException(typeof(InvalidOperationException), AllowDerivedTypes = false)]
public void SetKernelBufferSizeErrorTest()
{
using (PacketCommunicator communicator = OpenOfflineDevice())
......@@ -187,7 +187,7 @@ namespace PcapDotNet.Core.Test
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
[ExpectedException(typeof(InvalidOperationException), AllowDerivedTypes = false)]
public void SetlKernelMinimumBytesToCopyErrorTest()
{
using (PacketCommunicator communicator = OpenOfflineDevice())
......@@ -244,14 +244,14 @@ namespace PcapDotNet.Core.Test
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
[ExpectedException(typeof(InvalidOperationException), AllowDerivedTypes = false)]
public void DumpToBadFileTest()
{
OpenOfflineDevice(10, _random.NextEthernetPacket(100), TimeSpan.Zero, "??");
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
[ExpectedException(typeof(InvalidOperationException), AllowDerivedTypes = false)]
public void EmptyNameTest()
{
OpenOfflineDevice(10, _random.NextEthernetPacket(100), TimeSpan.Zero, string.Empty);
......
......@@ -7,8 +7,8 @@ namespace PcapDotNet.Core.Test
{
internal class PacketHandler
{
public PacketHandler(Packet expectedPacket, DateTime expectedMinTimestamp, DateTime expectedMaxTimestamp,
PacketCommunicator communicator, int numPacketsToBreakLoop)
public PacketHandler(Packet expectedPacket, DateTime expectedMinTimestamp, DateTime expectedMaxTimestamp,
PacketCommunicator communicator, int numPacketsToBreakLoop)
{
_expectedPacket = expectedPacket;
_expectedMinTimestamp = expectedMinTimestamp;
......
......@@ -52,7 +52,7 @@ namespace PcapDotNet.Core.Test
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
[ExpectedException(typeof(InvalidOperationException), AllowDerivedTypes = false)]
public void TransmitQueueToOfflineTest()
{
const string SourceMac = "11:22:33:44:55:66";
......
......@@ -71,7 +71,7 @@ namespace PcapDotNet.Core.Test
}
[TestMethod]
[ExpectedException(typeof(NotSupportedException))]
[ExpectedException(typeof(NotSupportedException), AllowDerivedTypes = false)]
public void UnsupportedKindErrorTest()
{
PcapDataLink dataLink = new PcapDataLink();
......@@ -79,7 +79,7 @@ namespace PcapDotNet.Core.Test
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
[ExpectedException(typeof(InvalidOperationException), AllowDerivedTypes = false)]
public void NoDescriptionErrorTest()
{
PcapDataLink dataLink = GetInvalidDataLink();
......
......@@ -91,7 +91,7 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentNullException))]
[ExpectedException(typeof(ArgumentNullException), AllowDerivedTypes = false)]
public void ByteArrayCompareFirstNullTest()
{
Assert.IsNotNull(ByteArrayExtensions.Compare(null, 1, new byte[1], 0, 1));
......@@ -99,7 +99,7 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentNullException))]
[ExpectedException(typeof(ArgumentNullException), AllowDerivedTypes = false)]
public void ByteArrayCompareSecondNullTest()
{
Assert.IsNotNull(new byte[1].Compare(1, null, 0, 1));
......@@ -107,7 +107,7 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentNullException))]
[ExpectedException(typeof(ArgumentNullException), AllowDerivedTypes = false)]
public void ByteArrayFindNullArrayTest()
{
Assert.IsNotNull(ByteArrayExtensions.Find(null, 1, 1, new byte[1]));
......@@ -115,7 +115,7 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentNullException))]
[ExpectedException(typeof(ArgumentNullException), AllowDerivedTypes = false)]
public void ByteArrayFindNullOtherTest()
{
Assert.IsNotNull(new byte[5].Find(1, 1, null));
......@@ -129,7 +129,7 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentNullException))]
[ExpectedException(typeof(ArgumentNullException), AllowDerivedTypes = false)]
public void ByteArraySequenceEqualNullArrayTest()
{
Assert.IsNotNull(ByteArrayExtensions.SequenceEqual(null, 1, new byte[1], 0, 1));
......@@ -137,7 +137,7 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentNullException))]
[ExpectedException(typeof(ArgumentNullException), AllowDerivedTypes = false)]
public void ByteArrayWriteNullEncodingTest()
{
int offset = 0;
......
......@@ -450,7 +450,7 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentException))]
[ExpectedException(typeof(ArgumentException), AllowDerivedTypes = false)]
public void HttpRequestMethodBadKnownTest()
{
Assert.IsNotNull(new HttpRequestMethod(HttpRequestKnownMethod.Unknown));
......@@ -532,7 +532,7 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentNullException))]
[ExpectedException(typeof(ArgumentNullException), AllowDerivedTypes = false)]
public void HttpCreateFieldNullEncoding()
{
HttpField field = HttpField.CreateField("abc", "cde", null);
......@@ -541,7 +541,7 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentNullException))]
[ExpectedException(typeof(ArgumentNullException), AllowDerivedTypes = false)]
public void HttpCreateFieldNullName()
{
HttpField field = HttpField.CreateField(null, "cde");
......
......@@ -133,7 +133,7 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentOutOfRangeException))]
[ExpectedException(typeof(ArgumentOutOfRangeException), AllowDerivedTypes = false)]
public void IgmpQueryVersion3SmallMaxResponseTimeTest()
{
Packet packet = PacketBuilder.Build(DateTime.Now, new EthernetLayer(), new IpV4Layer(),
......@@ -148,7 +148,7 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentOutOfRangeException))]
[ExpectedException(typeof(ArgumentOutOfRangeException), AllowDerivedTypes = false)]
public void IgmpQueryVersion3BigMaxResponseTimeTest()
{
Packet packet = PacketBuilder.Build(DateTime.Now, new EthernetLayer(), new IpV4Layer(),
......@@ -163,7 +163,7 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentOutOfRangeException))]
[ExpectedException(typeof(ArgumentOutOfRangeException), AllowDerivedTypes = false)]
public void IgmpQueryVersion3SmallQueryIntervalTest()
{
Packet packet = PacketBuilder.Build(DateTime.Now, new EthernetLayer(), new IpV4Layer(),
......@@ -178,7 +178,7 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentOutOfRangeException))]
[ExpectedException(typeof(ArgumentOutOfRangeException), AllowDerivedTypes = false)]
public void IgmpQueryVersion3BigQueryIntervalTest()
{
Packet packet = PacketBuilder.Build(DateTime.Now, new EthernetLayer(), new IpV4Layer(),
......@@ -193,7 +193,7 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentOutOfRangeException))]
[ExpectedException(typeof(ArgumentOutOfRangeException), AllowDerivedTypes = false)]
public void IgmpQueryVersion2SmallMaxResponseTimeTest()
{
Packet packet = PacketBuilder.Build(DateTime.Now,
......@@ -208,7 +208,7 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentOutOfRangeException))]
[ExpectedException(typeof(ArgumentOutOfRangeException), AllowDerivedTypes = false)]
public void IgmpQueryVersion2BigMaxResponseTimeTest()
{
Packet packet = PacketBuilder.Build(DateTime.Now, new EthernetLayer(), new IpV4Layer(),
......@@ -345,7 +345,7 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
[ExpectedException(typeof(InvalidOperationException), AllowDerivedTypes = false)]
public void IgmpIllegalReportVersionTest()
{
Packet packet = PacketBuilder.Build(DateTime.Now, new EthernetLayer(), new IpV4Layer(), new IgmpReportVersion1Layer());
......@@ -363,7 +363,7 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
[ExpectedException(typeof(InvalidOperationException), AllowDerivedTypes = false)]
public void IgmpIllegalQueryVersionTest()
{
Packet packet = PacketBuilder.Build(DateTime.Now, new EthernetLayer(), new IpV4Layer(), new IgmpQueryVersion1Layer());
......@@ -406,7 +406,7 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
[ExpectedException(typeof(InvalidOperationException), AllowDerivedTypes = false)]
public void IgmpExtractLayerBadMessageTypeTest()
{
Packet packet = PacketBuilder.Build(DateTime.Now, new EthernetLayer(), new IpV4Layer(), new IgmpReportVersion1Layer());
......@@ -419,7 +419,7 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentOutOfRangeException))]
[ExpectedException(typeof(ArgumentOutOfRangeException), AllowDerivedTypes = false)]
public void IgmpTooBigQueryRobustnessVariableTest()
{
Packet packet = PacketBuilder.Build(DateTime.Now, new EthernetLayer(), new IpV4Layer(), new IgmpQueryVersion3Layer
......
......@@ -158,7 +158,7 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentOutOfRangeException))]
[ExpectedException(typeof(ArgumentOutOfRangeException), AllowDerivedTypes = false)]
public void IpV4OptionTimestampOverflowErrorTest()
{
Random random = new Random();
......@@ -168,7 +168,7 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentOutOfRangeException))]
[ExpectedException(typeof(ArgumentOutOfRangeException), AllowDerivedTypes = false)]
public void IpV4OptionTimestampPointedIndexErrorTest()
{
Random random = new Random();
......@@ -223,7 +223,7 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentOutOfRangeException))]
[ExpectedException(typeof(ArgumentOutOfRangeException), AllowDerivedTypes = false)]
public void IpV4OptionRoutePointedAddressIndexErrorTest()
{
Random random = new Random();
......@@ -336,7 +336,7 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentOutOfRangeException))]
[ExpectedException(typeof(ArgumentOutOfRangeException), AllowDerivedTypes = false)]
public void IpV4OptionBasicSecurityConstructorBadLengthTest()
{
IpV4OptionBasicSecurity option = new IpV4OptionBasicSecurity(IpV4OptionSecurityClassificationLevel.Secret, IpV4OptionSecurityProtectionAuthorities.None, 1);
......@@ -429,7 +429,7 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
[ExpectedException(typeof(ArgumentOutOfRangeException))]
[ExpectedException(typeof(ArgumentOutOfRangeException), AllowDerivedTypes = false)]
public void IpV4OptionQuickStartBadRateTest()
{
IpV4OptionQuickStart option = new IpV4OptionQuickStart(IpV4OptionQuickStartFunction.RateRequest, 100, 1, 32);
......
......@@ -174,7 +174,7 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
[ExpectedException(typeof(InvalidOperationException))]
[ExpectedException(typeof(InvalidOperationException), AllowDerivedTypes = false)]
public void TcpOptionMoodBadEmotionStringTest()
{
Assert.IsNotNull(new TcpOptionMood((TcpOptionMoodEmotion)202).EmotionString);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment