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
47e5ee88
Commit
47e5ee88
authored
Mar 31, 2012
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code coverage 95.66%
parent
2c6cf6da
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
1 deletion
+63
-1
MatchExtensionsTest.cs
PcapDotNet/src/PcapDotNet.Base.Test/MatchExtensionsTest.cs
+50
-0
PcapDotNet.Base.Test.csproj
...tNet/src/PcapDotNet.Base.Test/PcapDotNet.Base.Test.csproj
+1
-0
SerialNumber32Test.cs
PcapDotNet/src/PcapDotNet.Base.Test/SerialNumber32Test.cs
+4
-0
LivePacketDeviceExtensionsTests.cs
...c/PcapDotNet.Core.Test/LivePacketDeviceExtensionsTests.cs
+8
-1
No files found.
PcapDotNet/src/PcapDotNet.Base.Test/MatchExtensionsTest.cs
0 → 100644
View file @
47e5ee88
using
System
;
using
System.Text.RegularExpressions
;
using
Microsoft.VisualStudio.TestTools.UnitTesting
;
namespace
PcapDotNet.Base.Test
{
/// <summary>
/// Summary description for MatchExtensionsTest
/// </summary>
[
TestClass
]
public
class
MatchExtensionsTest
{
/// <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
GroupCapturesValuesNullMatchTest
()
{
Match
match
=
null
;
Assert
.
IsNull
(
match
.
GroupCapturesValues
(
"someGroup"
));
Assert
.
Fail
();
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Base.Test/PcapDotNet.Base.Test.csproj
View file @
47e5ee88
...
...
@@ -72,6 +72,7 @@
<Compile
Include=
"IDictionaryExtensionsTests.cs"
/>
<Compile
Include=
"FuncExtensionsTest.cs"
/>
<Compile
Include=
"IEnumerableExtensionsTests.cs"
/>
<Compile
Include=
"MatchExtensionsTest.cs"
/>
<Compile
Include=
"MemberInfoExtensionsTests.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
<Compile
Include=
"PropertyInfoExtensionsTests.cs"
/>
...
...
PcapDotNet/src/PcapDotNet.Base.Test/SerialNumber32Test.cs
View file @
47e5ee88
...
...
@@ -59,6 +59,10 @@ namespace PcapDotNet.Base.Test
Assert
.
IsTrue
(
new
SerialNumber32
(
1
)
<
new
SerialNumber32
(
2
));
Assert
.
IsTrue
(
new
SerialNumber32
(
2
)
>
new
SerialNumber32
(
1
));
// ReSharper disable EqualExpressionComparison
Assert
.
IsFalse
(
new
SerialNumber32
(
1
)
<
new
SerialNumber32
(
1
));
Assert
.
IsFalse
(
new
SerialNumber32
(
1
)
>
new
SerialNumber32
(
1
));
// ReSharper restore EqualExpressionComparison
Assert
.
IsTrue
(
new
SerialNumber32
(
2
)
!=
new
SerialNumber32
(
1
));
Assert
.
IsFalse
(
new
SerialNumber32
(
1
)
!=
new
SerialNumber32
(
0
).
Add
(
1
));
Assert
.
IsTrue
(
new
SerialNumber32
(
2
)
==
new
SerialNumber32
(
1
).
Add
(
1
));
...
...
PcapDotNet/src/PcapDotNet.Core.Test/LivePacketDeviceExtensionsTests.cs
View file @
47e5ee88
...
...
@@ -52,8 +52,15 @@ namespace PcapDotNet.Core.Test
foreach
(
LivePacketDevice
device
in
LivePacketDevice
.
AllLocalMachine
)
{
Assert
.
IsNotNull
(
device
.
GetMacAddress
());
Console
.
WriteLine
(
device
.
GetMacAddress
());
}
}
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentNullException
),
AllowDerivedTypes
=
false
)]
public
void
GetGuidNullDeviceTest
()
{
Assert
.
IsNotNull
((
null
as
LivePacketDevice
).
GetGuid
());
Assert
.
Fail
();
}
}
}
\ No newline at end of file
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