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
27c3ee0f
Commit
27c3ee0f
authored
Aug 02, 2014
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code Coverage 95.15%
parent
f122ddb1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
IpV6Tests.cs
PcapDotNet/src/PcapDotNet.Packets.Test/IpV6Tests.cs
+46
-0
No files found.
PcapDotNet/src/PcapDotNet.Packets.Test/IpV6Tests.cs
View file @
27c3ee0f
...
...
@@ -90,6 +90,7 @@ namespace PcapDotNet.Packets.Test
{
Assert
.
IsFalse
(
extensionHeaderMobility
.
Equals
(
2
));
Assert
.
IsTrue
(
extensionHeaderMobility
.
Equals
((
object
)
extensionHeader
));
Assert
.
AreEqual
(
extensionHeaderMobility
.
MobilityOptions
,
new
IpV6MobilityOptions
(
extensionHeaderMobility
.
MobilityOptions
).
AsEnumerable
());
foreach
(
IpV6MobilityOption
option
in
extensionHeaderMobility
.
MobilityOptions
)
{
switch
(
option
.
OptionType
)
...
...
@@ -130,6 +131,23 @@ namespace PcapDotNet.Packets.Test
IpV6MobilityOptionTimestamp
optionTimestamp
=
(
IpV6MobilityOptionTimestamp
)
option
;
MoreAssert
.
IsBiggerOrEqual
(
new
DateTime
(
1970
,
1
,
1
,
0
,
0
,
0
,
DateTimeKind
.
Utc
),
optionTimestamp
.
TimestampDateTime
);
break
;
case
IpV6MobilityOptionType
.
FlowIdentification
:
IpV6MobilityOptionFlowIdentification
optionFlowIdentification
=
(
IpV6MobilityOptionFlowIdentification
)
option
;
foreach
(
IpV6FlowIdentificationSubOption
subOption
in
optionFlowIdentification
.
SubOptions
)
{
switch
(
subOption
.
OptionType
)
{
case
IpV6FlowIdentificationSubOptionType
.
BindingReference
:
IpV6FlowIdentificationSubOptionBindingReference
subOptionBindingReference
=
(
IpV6FlowIdentificationSubOptionBindingReference
)
subOption
;
Assert
.
AreEqual
(
subOptionBindingReference
,
new
IpV6FlowIdentificationSubOptionBindingReference
(
subOptionBindingReference
.
BindingIds
.
AsEnumerable
()));
break
;
}
}
break
;
}
}
}
...
...
@@ -379,5 +397,33 @@ namespace PcapDotNet.Packets.Test
new
IpV6Address
(
"0000:0000:9ABC:DEF0:1234:5678:9ABC:DEF0"
),
new
IpV6Address
(
"0000:0001:9ABC:DEF0:1234:5678:9ABC:DEF0"
)));
}
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentException
),
AllowDerivedTypes
=
false
)]
public
void
IpV6OptionCalipsoCompartmentBitmapDoesntDivideBy4
()
{
Assert
.
IsNull
(
new
IpV6OptionCalipso
(
IpV6CalipsoDomainOfInterpretation
.
Null
,
0
,
null
,
new
DataSegment
(
new
byte
[
6
])));
}
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentOutOfRangeException
),
AllowDerivedTypes
=
false
)]
public
void
IpV6OptionCalipsoCompartmentBitmapTooLong
()
{
Assert
.
IsNull
(
new
IpV6OptionCalipso
(
IpV6CalipsoDomainOfInterpretation
.
Null
,
0
,
null
,
new
DataSegment
(
new
byte
[
248
])));
}
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentOutOfRangeException
),
AllowDerivedTypes
=
false
)]
public
void
IpV6OptionSmfDpdDefaultTaggerIdTooLong
()
{
Assert
.
IsNull
(
new
IpV6OptionSmfDpdDefault
(
new
DataSegment
(
new
byte
[
17
]),
DataSegment
.
Empty
));
}
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentOutOfRangeException
),
AllowDerivedTypes
=
false
)]
public
void
IpV6OptionSmfDpdDefaultTaggerIdTooShort
()
{
Assert
.
IsNull
(
new
IpV6OptionSmfDpdDefault
(
DataSegment
.
Empty
,
DataSegment
.
Empty
));
}
}
}
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