Skip to content

Commit 531da75

Browse files
Mohammad DehghanMohammad Dehghan
Mohammad Dehghan
authored and
Mohammad Dehghan
committed
Add tests for dynamic port
1 parent f75889e commit 531da75

File tree

4 files changed

+45
-6
lines changed

4 files changed

+45
-6
lines changed

SG.CodeCoverage.Tests.NetFx/SG.CodeCoverage.Tests.NetFx.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@
4747
<Compile Include="Coverage\CoverageResultTests.cs" />
4848
<Compile Include="Properties\AssemblyInfo.cs" />
4949
<Compile Include="InstrumenterTester.cs" />
50-
<Compile Include="TestInstrumentation.cs" />
50+
<Compile Include="TestInstrumentation_DynamicPort.cs" />
51+
<Compile Include="TestInstrumentation_FixedPort.cs" />
52+
<Compile Include="TestInstrumentationBase.cs" />
5153
</ItemGroup>
5254
<ItemGroup>
5355
<ProjectReference Include="..\SampleProjectForTest\SampleProjectForTest.csproj">

SG.CodeCoverage.Tests.NetFx/TestInstrumentation.cs renamed to SG.CodeCoverage.Tests.NetFx/TestInstrumentationBase.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99

1010
namespace SG.CodeCoverage.Tests.NetFx
1111
{
12-
[TestClass]
13-
public class TestInstrumentation
12+
public abstract class TestInstrumentationBase
1413
{
1514
InstrumenterTester _tester;
1615

17-
[TestInitialize]
18-
public void Instrument()
16+
public TestInstrumentationBase(int port)
1917
{
20-
_tester = new InstrumenterTester();
18+
_tester = new InstrumenterTester()
19+
{
20+
PortNumber = port
21+
};
2122
_tester.InstrumentSampleProject();
2223
}
2324

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
8+
namespace SG.CodeCoverage.Tests.NetFx
9+
{
10+
[TestClass]
11+
public class TestInstrumentation_DynamicPort : TestInstrumentationBase
12+
{
13+
public TestInstrumentation_DynamicPort()
14+
: base(0)
15+
{
16+
}
17+
}
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
8+
namespace SG.CodeCoverage.Tests.NetFx
9+
{
10+
[TestClass]
11+
public class TestInstrumentation_FixedPort : TestInstrumentationBase
12+
{
13+
public TestInstrumentation_FixedPort()
14+
: base(62383)
15+
{
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)