Skip to content

Commit 4f90718

Browse files
committed
make sure zipstrings tests always run first
1 parent abb649a commit 4f90718

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

test/ICSharpCode.SharpZipLib.Tests/Zip/ZipStringsTests.cs

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
using ICSharpCode.SharpZipLib.Tests.TestSupport;
2+
using ICSharpCode.SharpZipLib.Tests.Zip;
23
using ICSharpCode.SharpZipLib.Zip;
34
using NUnit.Framework;
45
using System;
56
using System.Collections.Generic;
6-
using System.Globalization;
77
using System.IO;
8-
using System.Linq;
9-
using System.Reflection;
108
using System.Text;
11-
using System.Threading.Tasks;
12-
using System.Xml.Linq;
13-
using static System.Net.WebRequestMethods;
14-
using Does = NUnit.Framework.Does;
9+
using Does = ICSharpCode.SharpZipLib.Tests.TestSupport.Does;
1510

16-
namespace ICSharpCode.SharpZipLib.Tests.Zip
11+
// As there is no way to order the test namespace execution order we use a name that should be alphabetically sorted before any other namespace
12+
// This is because we have one test that only works when no encoding provider has been loaded which is not reversable once done.
13+
namespace ICSharpCode.SharpZipLib.Tests._Zip
1714
{
1815
[TestFixture]
19-
[Order(0)]
16+
[Order(1)]
2017
public class ZipStringsTests
2118
{
2219
[Test]
23-
[Order(0)]
20+
[Order(1)]
2421
// NOTE: This test needs to be run before any test registering CodePagesEncodingProvider.Instance
2522
public void TestSystemDefaultEncoding()
2623
{
@@ -37,7 +34,7 @@ public void TestSystemDefaultEncoding()
3734
}
3835

3936
[Test]
40-
[Order(1)]
37+
[Order(2)]
4138
public void TestFastZipRoundTripWithCodePage()
4239
{
4340
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
@@ -72,7 +69,7 @@ public void TestFastZipRoundTripWithCodePage()
7269

7370

7471
[Test]
75-
[Order(1)]
72+
[Order(2)]
7673
public void TestZipFileRoundTripWithCodePage()
7774
{
7875
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
@@ -98,7 +95,7 @@ public void TestZipFileRoundTripWithCodePage()
9895
}
9996

10097
[Test]
101-
[Order(1)]
98+
[Order(2)]
10299
public void TestZipStreamRoundTripWithCodePage()
103100
{
104101
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
@@ -121,7 +118,7 @@ public void TestZipStreamRoundTripWithCodePage()
121118
}
122119

123120
[Test]
124-
[Order(1)]
121+
[Order(2)]
125122
public void TestZipCryptoPasswordEncodingRoundtrip()
126123
{
127124
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
@@ -150,7 +147,7 @@ public void TestZipCryptoPasswordEncodingRoundtrip()
150147
}
151148

152149
[Test]
153-
[Order(1)]
150+
[Order(2)]
154151
public void TestZipStreamCommentEncodingRoundtrip()
155152
{
156153
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
@@ -171,7 +168,7 @@ public void TestZipStreamCommentEncodingRoundtrip()
171168

172169

173170
[Test]
174-
[Order(1)]
171+
[Order(2)]
175172
public void TestZipFileCommentEncodingRoundtrip()
176173
{
177174
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

0 commit comments

Comments
 (0)