Commit 47e5ee88 authored by Brickner_cp's avatar Brickner_cp

Code coverage 95.66%

parent 2c6cf6da
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
......@@ -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" />
......
......@@ -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));
......
......@@ -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
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