Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pcap-Net
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Pcap-Net
Commits
b66549bf
Commit
b66549bf
authored
Sep 26, 2014
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code Coverage 96.25%
parent
d84f10c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
91 additions
and
0 deletions
+91
-0
IpV6Tests.cs
PcapDotNet/src/PcapDotNet.Packets.Test/IpV6Tests.cs
+91
-0
No files found.
PcapDotNet/src/PcapDotNet.Packets.Test/IpV6Tests.cs
View file @
b66549bf
...
...
@@ -87,9 +87,12 @@ namespace PcapDotNet.Packets.Test
Assert
.
AreEqual
(
ipV6Layer
,
packet
.
Ethernet
.
IpV6
.
ExtractLayer
(),
"IP Layer"
);
Assert
.
AreEqual
(
ipV6Layer
.
GetHashCode
(),
packet
.
Ethernet
.
IpV6
.
ExtractLayer
().
GetHashCode
(),
"IP Layer"
);
Assert
.
AreEqual
(
string
.
Format
(
"{0} -> {1} ({2})"
,
ipV6Layer
.
Source
,
ipV6Layer
.
CurrentDestination
,
ipV6Layer
.
NextHeader
),
ipV6Layer
.
ToString
());
IEnumerator
extensionHeadersEnumerator
=
((
IEnumerable
)
packet
.
Ethernet
.
IpV6
.
ExtensionHeaders
).
GetEnumerator
();
for
(
int
extensionHeaderIndex
=
0
;
extensionHeaderIndex
!=
packet
.
Ethernet
.
IpV6
.
ExtensionHeaders
.
Headers
.
Count
;
++
extensionHeaderIndex
)
{
IpV6ExtensionHeader
extensionHeader
=
packet
.
Ethernet
.
IpV6
.
ExtensionHeaders
[
extensionHeaderIndex
];
Assert
.
IsTrue
(
extensionHeadersEnumerator
.
MoveNext
());
Assert
.
AreEqual
(
extensionHeader
,
extensionHeadersEnumerator
.
Current
);
IpV6ExtensionHeader
layerExtensionheader
=
ipV6Layer
.
ExtensionHeaders
[
extensionHeaderIndex
];
Assert
.
AreEqual
(
extensionHeader
,
layerExtensionheader
);
Assert
.
AreEqual
(
extensionHeader
.
GetHashCode
(),
layerExtensionheader
.
GetHashCode
());
...
...
@@ -2402,6 +2405,86 @@ namespace PcapDotNet.Packets.Test
Assert
.
IsFalse
(
invalidPacket
.
IsValid
);
}
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentNullException
),
AllowDerivedTypes
=
false
)]
public
void
IpV6OptionHomeAddressCreateInstanceNullData
()
{
Assert
.
IsNull
(
new
IpV6OptionHomeAddress
(
IpV6Address
.
Zero
).
CreateInstance
(
null
));
Assert
.
Fail
();
}
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentNullException
),
AllowDerivedTypes
=
false
)]
public
void
IpV6OptionJumboPayloadCreateInstanceNullData
()
{
Assert
.
IsNull
(
new
IpV6OptionJumboPayload
(
2000
).
CreateInstance
(
null
));
Assert
.
Fail
();
}
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentNullException
),
AllowDerivedTypes
=
false
)]
public
void
IpV6OptionRouterAlertCreateInstanceNullData
()
{
Assert
.
IsNull
(
new
IpV6OptionRouterAlert
(
IpV6RouterAlertType
.
Rsvp
).
CreateInstance
(
null
));
Assert
.
Fail
();
}
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentNullException
),
AllowDerivedTypes
=
false
)]
public
void
IpV6OptionTunnelEncapsulationLimitCreateInstanceNullData
()
{
Assert
.
IsNull
(
new
IpV6OptionTunnelEncapsulationLimit
(
10
).
CreateInstance
(
null
));
Assert
.
Fail
();
}
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentNullException
),
AllowDerivedTypes
=
false
)]
public
void
IpV6OptionPadNCreateInstanceNullData
()
{
Assert
.
IsNull
(
new
IpV6OptionPadN
(
10
).
CreateInstance
(
null
));
Assert
.
Fail
();
}
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentNullException
),
AllowDerivedTypes
=
false
)]
public
void
IpV6MobilityOptionCryptographicallyGeneratedAddressParametersNullCryptographicallyGeneratedAddressParameters
()
{
Assert
.
IsNull
(
new
IpV6MobilityOptionCryptographicallyGeneratedAddressParameters
(
null
));
Assert
.
Fail
();
}
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentNullException
),
AllowDerivedTypes
=
false
)]
public
void
IpV6MobilityOptionMobileNodeIdentifierNullIdentifier
()
{
Assert
.
IsNull
(
new
IpV6MobilityOptionMobileNodeIdentifier
(
IpV6MobileNodeIdentifierSubtype
.
NetworkAccessIdentifier
,
null
));
Assert
.
Fail
();
}
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentNullException
),
AllowDerivedTypes
=
false
)]
public
void
IpV6MobilityOptionContextRequestEntryNullOption
()
{
Assert
.
IsNull
(
new
IpV6MobilityOptionContextRequestEntry
(
0
,
null
));
Assert
.
Fail
();
}
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentNullException
),
AllowDerivedTypes
=
false
)]
public
void
IpV6MobilityOptionServiceSelectionNullIdentifier
()
{
Assert
.
IsNull
(
new
IpV6MobilityOptionServiceSelection
(
null
));
Assert
.
Fail
();
}
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentNullException
),
AllowDerivedTypes
=
false
)]
public
void
PppFrameCheckSequenceCalculatorCalculateFrameCheckSequence16NullBytes
()
{
Assert
.
IsNull
(
PppFrameCheckSequenceCalculator
.
CalculateFrameCheckSequence16
(
0
,
null
));
Assert
.
Fail
();
}
[
TestMethod
]
public
void
IpV6OptionJumboPayloadDataTooShort
()
{
...
...
@@ -2541,6 +2624,14 @@ namespace PcapDotNet.Packets.Test
Assert
.
IsFalse
(
invalidPacket
.
IsValid
);
}
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentNullException
),
AllowDerivedTypes
=
false
)]
public
void
IpV6ExtensionHeaderMobilityExperimentalNullMessageData
()
{
Assert
.
IsNull
(
new
IpV6ExtensionHeaderMobilityExperimental
(
IpV4Protocol
.
Pin
,
0
,
null
));
Assert
.
Fail
();
}
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentException
),
AllowDerivedTypes
=
false
)]
public
void
IpV6ExtensionHeaderMobilityExperimentalConstructorMessageDataBadLength
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment