Skip to content
This repository has been archived by the owner on Apr 22, 2019. It is now read-only.

Commit

Permalink
Converted a few Fact test cases to Theory. Retired download badge.
Browse files Browse the repository at this point in the history
  • Loading branch information
lextm committed Mar 26, 2016
1 parent 2aa870c commit b1f1921
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
32 changes: 17 additions & 15 deletions Tests/Messaging/Tests/GetRequestMessageTestFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,12 @@ public void TestResponse()
engine.Stop();
}

[Fact]
public async void TestResponsesFromMultipleSources()
[Theory]
[InlineData(256)]
public async void TestResponsesFromMultipleSources(int count)
{
var start = 16102;
var end = start + 512;
var end = start + count;
var engine = CreateEngine();
engine.Listener.ClearBindings();
for (var index = start; index < end; index++)
Expand All @@ -340,8 +341,7 @@ public async void TestResponsesFromMultipleSources()
var time = DateTime.Now;
engine.Start();
Console.WriteLine(DateTime.Now - time);

const int timeout = 100000;

for (int index = start; index < end; index++)
//Parallel.For(start, end, async index =>
{
Expand All @@ -365,11 +365,12 @@ public async void TestResponsesFromMultipleSources()
engine.Stop();
}

[Fact]
public async void TestResponsesFromSingleSource()
[Theory]
[InlineData(32)]
public async void TestResponsesFromSingleSource(int count)
{
var start = 0;
var end = start + 32;
var end = start + count;
var engine = CreateEngine();
engine.Listener.ClearBindings();
engine.Listener.AddBinding(new IPEndPoint(IPAddress.Loopback, 17000));
Expand All @@ -385,7 +386,6 @@ public async void TestResponsesFromSingleSource()
engine.Start();
Console.WriteLine(DateTime.Now - time);

const int timeout = 100000;
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
for (int index = start; index < end; index++)
//Parallel.For(start, end, async index =>
Expand All @@ -409,11 +409,12 @@ public async void TestResponsesFromSingleSource()
engine.Stop();
}

[Fact]
public void TestResponsesFromSingleSourceWithMultipleThreads()
[Theory]
[InlineData(32)]
public void TestResponsesFromSingleSourceWithMultipleThreads(int count)
{
var start = 0;
var end = start + 32;
var end = start + count;
var engine = CreateEngine();
engine.Listener.ClearBindings();
engine.Listener.AddBinding(new IPEndPoint(IPAddress.Loopback, 17000));
Expand Down Expand Up @@ -458,11 +459,12 @@ public void TestResponsesFromSingleSourceWithMultipleThreads()
engine.Stop();
}

[Fact]
public void TestResponsesFromSingleSourceWithMultipleThreadsFromManager()
[Theory]
[InlineData(256)]
public void TestResponsesFromSingleSourceWithMultipleThreadsFromManager(int count)
{
var start = 0;
var end = start + 256;
var end = start + count;
var engine = CreateEngine();
engine.Listener.ClearBindings();
engine.Listener.AddBinding(new IPEndPoint(IPAddress.Loopback, 17000));
Expand Down
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Build status](https://ci.appveyor.com/api/projects/status/7il4faq46rpgd2np)](https://ci.appveyor.com/project/lextm/sharpsnmplib) [![NuGet Version](https://img.shields.io/nuget/v/Lextm.SharpSnmpLib.svg?style=flat)](https://www.nuget.org/packages/Lextm.SharpSnmpLib/) [![NuGet Downloads](https://img.shields.io/nuget/dt/Lextm.SharpSnmpLib.svg?style=flat)](https://www.nuget.org/packages/Lextm.SharpSnmpLib/)
[![Build status](https://ci.appveyor.com/api/projects/status/7il4faq46rpgd2np)](https://ci.appveyor.com/project/lextm/sharpsnmplib)
[![NuGet Version](https://img.shields.io/nuget/v/Lextm.SharpSnmpLib.svg?style=flat)](https://www.nuget.org/packages/Lextm.SharpSnmpLib/)

This is the source code repository of #SNMP Library. Visual Studio 2015 Update 1 is required to compile it on Windows.

Expand Down

0 comments on commit b1f1921

Please sign in to comment.