Skip to content

Commit 338d5da

Browse files
authored
fix/block-scoped-namespace (#345)
* Fix: block scoped namespace * Update build.yml
1 parent ef22f25 commit 338d5da

File tree

65 files changed

+2799
-2734
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+2799
-2734
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
restore-keys: ${{ runner.os }}-sonar
2727
- name: Cache SonarCloud scanner
2828
id: cache-sonar-scanner
29-
uses: actions/cache@v1
29+
uses: actions/cache@v3
3030
with:
3131
path: .\.sonar\scanner
3232
key: ${{ runner.os }}-sonar-scanner

src/TestProject/BigIntegerBitWiseUnitTest.cs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
// Copyright (c) IPNetwork. All rights reserved.
33
// </copyright>
44

5-
namespace TestProject;
6-
7-
[TestClass]
8-
public class BigIntegerBitWiseUnitTest
5+
namespace TestProject
96
{
10-
[TestMethod]
11-
[DataRow(new byte[] { 0xFF, 0xFF, 0xFF, 0xFF, 0x00 }, 4, new byte[] { 0x0 })]
12-
[DataRow(new byte[] { 0xFF, 0xFF, 0xFF, 0xFF, 0x00 }, 8,
13-
new byte[] { 0x0, 0x0, 0x0, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0 })]
14-
public void Test1(byte[] bytes, int reverseLength, byte[] expected)
7+
[TestClass]
8+
public class BigIntegerBitWiseUnitTest
159
{
10+
[TestMethod]
11+
[DataRow(new byte[] { 0xFF, 0xFF, 0xFF, 0xFF, 0x00 }, 4, new byte[] { 0x0 })]
12+
[DataRow(new byte[] { 0xFF, 0xFF, 0xFF, 0xFF, 0x00 }, 8,
13+
new byte[] { 0x0, 0x0, 0x0, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0 })]
14+
public void Test1(byte[] bytes, int reverseLength, byte[] expected)
15+
{
1616
var reverseme = new BigInteger(bytes);
1717
BigInteger reversed = reverseme.PositiveReverse(reverseLength);
1818
byte[] result = reversed.ToByteArray();
@@ -23,4 +23,5 @@ public void Test1(byte[] bytes, int reverseLength, byte[] expected)
2323
Assert.AreEqual(expected[i], result[i], i.ToString());
2424
}
2525
}
26+
}
2627
}

src/TestProject/BigIntegerToUnitTest.cs

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
// Copyright (c) IPNetwork. All rights reserved.
33
// </copyright>
44

5-
namespace TestProject;
6-
7-
[TestClass]
8-
public class BigIntegerToUnitTest
5+
namespace TestProject
96
{
10-
[TestMethod]
11-
public void TestToOctalString1()
7+
[TestClass]
8+
public class BigIntegerToUnitTest
9+
{
10+
[TestMethod]
11+
public void TestToOctalString1()
1212
{
1313
byte[] bytes = { 0xFF, 0xFF, 0xFF, 0xFF, 0x00 };
1414
var convertme = new BigInteger(bytes);
@@ -17,8 +17,8 @@ public void TestToOctalString1()
1717
Assert.AreEqual("037777777777", result);
1818
}
1919

20-
[TestMethod]
21-
public void TestToOctalString3()
20+
[TestMethod]
21+
public void TestToOctalString3()
2222
{
2323
var bigi = BigInteger.Parse("1048576");
2424
bigi++;
@@ -27,8 +27,8 @@ public void TestToOctalString3()
2727
Assert.AreEqual("04000001", result);
2828
}
2929

30-
[TestMethod]
31-
public void TestToOctalString01()
30+
[TestMethod]
31+
public void TestToOctalString01()
3232
{
3333
BigInteger bigi = BigInteger.Zero;
3434
bigi++;
@@ -37,8 +37,8 @@ public void TestToOctalString01()
3737
Assert.AreEqual("01", result);
3838
}
3939

40-
[TestMethod]
41-
public void TestToOctalString02()
40+
[TestMethod]
41+
public void TestToOctalString02()
4242
{
4343
BigInteger bigi = BigInteger.Zero;
4444
bigi--;
@@ -47,8 +47,8 @@ public void TestToOctalString02()
4747
Assert.AreEqual("377", result);
4848
}
4949

50-
[TestMethod]
51-
public void TestToOctalString03()
50+
[TestMethod]
51+
public void TestToOctalString03()
5252
{
5353
BigInteger bigi = BigInteger.Zero;
5454
bigi--;
@@ -63,8 +63,8 @@ public void TestToOctalString03()
6363
Assert.AreEqual("371", result);
6464
}
6565

66-
[TestMethod]
67-
public void TestToHexadecimalString1()
66+
[TestMethod]
67+
public void TestToHexadecimalString1()
6868
{
6969
byte[] bytes = { 0xFF, 0xFF, 0xFF, 0xFF, 0x00 };
7070
var convertme = new BigInteger(bytes);
@@ -73,8 +73,8 @@ public void TestToHexadecimalString1()
7373
Assert.AreEqual("0FFFFFFFF", result);
7474
}
7575

76-
[TestMethod]
77-
public void TestToBinaryString1()
76+
[TestMethod]
77+
public void TestToBinaryString1()
7878
{
7979
byte[] bytes = { 0xFF, 0xFF, 0xFF, 0xFF, 0x00 };
8080
var convertme = new BigInteger(bytes);
@@ -83,8 +83,8 @@ public void TestToBinaryString1()
8383
Assert.AreEqual("011111111111111111111111111111111", result);
8484
}
8585

86-
[TestMethod]
87-
public void TestToBinaryString01()
86+
[TestMethod]
87+
public void TestToBinaryString01()
8888
{
8989
BigInteger bigi = BigInteger.Zero;
9090
bigi++;
@@ -93,17 +93,17 @@ public void TestToBinaryString01()
9393
Assert.AreEqual("01", result);
9494
}
9595

96-
[TestMethod]
97-
public void TestToBinaryString2()
96+
[TestMethod]
97+
public void TestToBinaryString2()
9898
{
9999
var convertme = new BigInteger(-1);
100100
string result = convertme.ToBinaryString();
101101

102102
Assert.AreEqual("11111111", result);
103103
}
104104

105-
[TestMethod]
106-
public void TestToBinaryString3()
105+
[TestMethod]
106+
public void TestToBinaryString3()
107107
{
108108
byte[] bytes =
109109
{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
@@ -112,4 +112,5 @@ public void TestToBinaryString3()
112112

113113
Assert.AreEqual("11111111", result);
114114
}
115+
}
115116
}

src/TestProject/CidrClassFullIpv4UnitTest.cs

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
// Copyright (c) IPNetwork. All rights reserved.
33
// </copyright>
44

5-
namespace TestProject;
6-
7-
[TestClass]
8-
public class CidrClassFullIpv4UnitTest
5+
namespace TestProject
96
{
10-
[TestMethod]
11-
public void TestTryGuessCidrNull()
7+
[TestClass]
8+
public class CidrClassFullIpv4UnitTest
9+
{
10+
[TestMethod]
11+
public void TestTryGuessCidrNull()
1212
{
1313
var cidrguess = new CidrClassFull();
1414

@@ -19,8 +19,8 @@ public void TestTryGuessCidrNull()
1919
Assert.AreEqual(0, cidr, "cidr");
2020
}
2121

22-
[TestMethod]
23-
public void TestTryGuessCidrA()
22+
[TestMethod]
23+
public void TestTryGuessCidrA()
2424
{
2525
var cidrguess = new CidrClassFull();
2626

@@ -31,8 +31,8 @@ public void TestTryGuessCidrA()
3131
Assert.AreEqual(8, cidr, "cidr");
3232
}
3333

34-
[TestMethod]
35-
public void TestTryGuessCidrB()
34+
[TestMethod]
35+
public void TestTryGuessCidrB()
3636
{
3737
var cidrguess = new CidrClassFull();
3838

@@ -43,8 +43,8 @@ public void TestTryGuessCidrB()
4343
Assert.AreEqual(16, cidr, "cidr");
4444
}
4545

46-
[TestMethod]
47-
public void TestTryGuessCidrC()
46+
[TestMethod]
47+
public void TestTryGuessCidrC()
4848
{
4949
var cidrguess = new CidrClassFull();
5050

@@ -55,8 +55,8 @@ public void TestTryGuessCidrC()
5555
Assert.AreEqual(24, cidr, "cidr");
5656
}
5757

58-
[TestMethod]
59-
public void TestTryGuessCidrD()
58+
[TestMethod]
59+
public void TestTryGuessCidrD()
6060
{
6161
var cidrguess = new CidrClassFull();
6262

@@ -67,8 +67,8 @@ public void TestTryGuessCidrD()
6767
Assert.AreEqual(24, cidr, "cidr");
6868
}
6969

70-
[TestMethod]
71-
public void TestTryGuessCidrE()
70+
[TestMethod]
71+
public void TestTryGuessCidrE()
7272
{
7373
var cidrguess = new CidrClassFull();
7474

@@ -78,4 +78,5 @@ public void TestTryGuessCidrE()
7878
Assert.AreEqual(true, parsed, "parsed");
7979
Assert.AreEqual(24, cidr, "cidr");
8080
}
81+
}
8182
}

src/TestProject/CidrClassFullIpv6UnitTest.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
// Copyright (c) IPNetwork. All rights reserved.
33
// </copyright>
44

5-
namespace TestProject;
6-
7-
[TestClass]
8-
public class CidrClassFullIpv6UnitTest
5+
namespace TestProject
96
{
10-
[TestMethod]
11-
public void TestIpV6TryGuessCidrNull()
7+
[TestClass]
8+
public class CidrClassFullIpv6UnitTest
9+
{
10+
[TestMethod]
11+
public void TestIpV6TryGuessCidrNull()
1212
{
1313
var cidrguess = new CidrClassFull();
1414

@@ -19,8 +19,8 @@ public void TestIpV6TryGuessCidrNull()
1919
Assert.AreEqual(0, cidr, "cidr");
2020
}
2121

22-
[TestMethod]
23-
public void TestIpV6TryGuessCidr1()
22+
[TestMethod]
23+
public void TestIpV6TryGuessCidr1()
2424
{
2525
var cidrguess = new CidrClassFull();
2626

@@ -31,8 +31,8 @@ public void TestIpV6TryGuessCidr1()
3131
Assert.AreEqual(64, cidr, "cidr");
3232
}
3333

34-
[TestMethod]
35-
public void TestIpV6TryGuessCidr2()
34+
[TestMethod]
35+
public void TestIpV6TryGuessCidr2()
3636
{
3737
var cidrguess = new CidrClassFull();
3838

@@ -42,4 +42,5 @@ public void TestIpV6TryGuessCidr2()
4242
Assert.AreEqual(true, parsed, "parsed");
4343
Assert.AreEqual(64, cidr, "cidr");
4444
}
45+
}
4546
}

0 commit comments

Comments
 (0)