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
8daded36
Commit
8daded36
authored
Aug 02, 2009
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve Maintainability
parent
16995cfa
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
105 additions
and
90 deletions
+105
-90
MoreRandomPackets.cs
...Net/src/PcapDotNet.Packets.TestUtils/MoreRandomPackets.cs
+99
-89
MoreRandom.cs
PcapDotNet/src/PcapDotNet.TestUtils/MoreRandom.cs
+6
-1
No files found.
PcapDotNet/src/PcapDotNet.Packets.TestUtils/MoreRandomPackets.cs
View file @
8daded36
This diff is collapsed.
Click to expand it.
PcapDotNet/src/PcapDotNet.TestUtils/MoreRandom.cs
View file @
8daded36
...
...
@@ -83,7 +83,7 @@ namespace PcapDotNet.TestUtils
return
new
DateTime
(
random
.
NextLong
(
DateTime
.
MinValue
.
Ticks
,
DateTime
.
MaxValue
.
Ticks
+
1
));
}
public
static
T
NextEnum
<
T
>(
this
Random
random
,
params
T
[]
valuesToIgnore
)
public
static
T
NextEnum
<
T
>(
this
Random
random
,
IEnumerable
<
T
>
valuesToIgnore
)
{
Type
type
=
typeof
(
T
);
if
(!
type
.
IsEnum
)
...
...
@@ -96,6 +96,11 @@ namespace PcapDotNet.TestUtils
return
(
T
)
random
.
NextValue
(
enumValues
);
}
public
static
T
NextEnum
<
T
>(
this
Random
random
,
params
T
[]
valuesToIgnore
)
{
return
random
.
NextEnum
((
IEnumerable
<
T
>)
valuesToIgnore
);
}
public
static
object
NextValue
<
T
>(
this
Random
random
,
IList
<
T
>
values
)
{
return
values
[
random
.
Next
(
values
.
Count
)];
...
...
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