Skip to content

Commit

Permalink
Fix issues compiling tests for .NET Core App (rename Main methods to …
Browse files Browse the repository at this point in the history
…MainOld)
  • Loading branch information
Oren Novotny committed Dec 5, 2016
1 parent 5b52d80 commit dd1b0b2
Show file tree
Hide file tree
Showing 293 changed files with 517 additions and 364 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ private void checkValues(
{
checkMandatoryField("information", information, syntax.Information);
}

public static void Main(
#if !LIB
public static void MainOld(
string[] args)
{
RunTest(new AdditionalInformationSyntaxUnitTest());
}
#endif

[Test]
public void TestFunction()
Expand Down
4 changes: 3 additions & 1 deletion crypto/test/src/asn1/test/AdmissionSyntaxUnitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,13 @@ private void checkValues(
}
}

public static void Main(
#if !LIB
public static void MainOld(
string[] args)
{
RunTest(new AdmissionSyntaxUnitTest());
}
#endif

[Test]
public void TestFunction()
Expand Down
5 changes: 3 additions & 2 deletions crypto/test/src/asn1/test/AdmissionsUnitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ private void checkValues(
checkMandatoryField("admissionAuthority", name, admissions.AdmissionAuthority);
checkMandatoryField("namingAuthority", auth, admissions.NamingAuthority);
}

public static void Main(
#if !LIB
public static void MainOld(
string[] args)
{
RunTest(new AdmissionsUnitTest());
}
#endif

[Test]
public void TestFunction()
Expand Down
2 changes: 1 addition & 1 deletion crypto/test/src/asn1/test/AllTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Org.BouncyCastle.Asn1.Tests
{
public class AllTests
{
public static void Main(string[] args)
public static void MainOld(string[] args)
{
Suite.Run(new NullListener(), NUnit.Core.TestFilter.Empty);
}
Expand Down
4 changes: 3 additions & 1 deletion crypto/test/src/asn1/test/AttributeTableUnitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,13 @@ public override void PerformTest()
}
}

public static void Main(
#if !LIB
public static void MainOld(
string[] args)
{
RunTest(new AttributeTableUnitTest());
}
#endif

[Test]
public void TestFunction()
Expand Down
4 changes: 3 additions & 1 deletion crypto/test/src/asn1/test/BiometricDataUnitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,13 @@ private void CheckValues(
}
}

public static void Main(
#if !LIB
public static void MainOld(
string[] args)
{
RunTest(new BiometricDataUnitTest());
}
#endif

[Test]
public void TestFunction()
Expand Down
4 changes: 3 additions & 1 deletion crypto/test/src/asn1/test/BitStringTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,13 @@ public override string Name
get { return "BitString"; }
}

public static void Main(
#if !LIB
public static void MainOld(
string[] args)
{
RunTest(new BitStringTest());
}
#endif

[Test]
public void TestFunction()
Expand Down
4 changes: 3 additions & 1 deletion crypto/test/src/asn1/test/CMSTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,16 @@ public string Name
get { return "CMS"; }
}

public static void Main(
#if !LIB
public static void MainOld(
string[] args)
{
ITest test = new CmsTest();
ITestResult result = test.Perform();

Console.WriteLine(result);
}
#endif

[Test]
public void TestFunction()
Expand Down
4 changes: 3 additions & 1 deletion crypto/test/src/asn1/test/CertHashUnitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ private void checkValues(
checkMandatoryField("certificateHash", digest, certHash.CertificateHash);
}

public static void Main(
#if !LIB
public static void MainOld(
string[] args)
{
RunTest(new CertHashUnitTest());
}
#endif

[Test]
public void TestFunction()
Expand Down
4 changes: 3 additions & 1 deletion crypto/test/src/asn1/test/CertificateTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,13 @@ public override void PerformTest()
CheckAttributeCertificate(8, cert8);
}

public static void Main(
#if !LIB
public static void MainOld(
string[] args)
{
RunTest(new CertificateTest());
}
#endif

[Test]
public void TestFunction()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,13 @@ private void CheckStatement(
}
}

public static void Main(
#if !LIB
public static void MainOld(
string[] args)
{
RunTest(new CommitmentTypeIndicationUnitTest());
}
#endif

[Test]
public void TestFunction()
Expand Down
4 changes: 3 additions & 1 deletion crypto/test/src/asn1/test/CommitmentTypeQualifierUnitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,13 @@ private void CheckStatement(
}
}

public static void Main(
#if !LIB
public static void MainOld(
string[] args)
{
RunTest(new CommitmentTypeQualifierUnitTest());
}
#endif

[Test]
public void TestFunction()
Expand Down
4 changes: 3 additions & 1 deletion crypto/test/src/asn1/test/ContentHintsUnitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ private void checkValues(
checkOptionalField("description", description, hints.ContentDescription);
}

public static void Main(
#if !LIB
public static void MainOld(
string[] args)
{
RunTest(new ContentHintsUnitTest());
}
#endif

[Test]
public void TestFunction()
Expand Down
4 changes: 3 additions & 1 deletion crypto/test/src/asn1/test/CscaMasterListTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ private byte[] GetInput(string name)
return Streams.ReadAll(SimpleTest.GetTestDataAsStream("asn1." + name));
}

public static void Main(
#if !LIB
public static void MainOld(
string[] args)
{
RunTest(new CscaMasterListTest());
}
#endif

[Test]
public void TestFunction()
Expand Down
4 changes: 3 additions & 1 deletion crypto/test/src/asn1/test/DERApplicationSpecificTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,13 @@ public override void PerformTest()
}
}

public static void Main(
#if !LIB
public static void MainOld(
string[] args)
{
RunTest(new DerApplicationSpecificTest());
}
#endif

[Test]
public void TestFunction()
Expand Down
4 changes: 3 additions & 1 deletion crypto/test/src/asn1/test/DERUTF8StringTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,16 @@ public string Name
}
}

public static void Main(
#if !LIB
public static void MainOld(
string[] args)
{
DerUtf8StringTest test = new DerUtf8StringTest();
ITestResult result = test.Perform();

Console.WriteLine(result);
}
#endif

[Test]
public void TestFunction()
Expand Down
4 changes: 3 additions & 1 deletion crypto/test/src/asn1/test/DataGroupHashUnitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,13 @@ private void CheckValues(
}
}

public static void Main(
#if !LIB
public static void MainOld(
string[] args)
{
RunTest(new DataGroupHashUnitTest());
}
#endif

[Test]
public void TestFunction()
Expand Down
4 changes: 3 additions & 1 deletion crypto/test/src/asn1/test/DeclarationOfMajorityUnitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,13 @@ private void checkValues(
}
}

public static void Main(
#if !LIB
public static void MainOld(
string[] args)
{
RunTest(new DeclarationOfMajorityUnitTest());
}
#endif

[Test]
public void TestFunction()
Expand Down
4 changes: 3 additions & 1 deletion crypto/test/src/asn1/test/EncryptedPrivateKeyInfoTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,16 @@ public ITestResult Perform()
return new SimpleTestResult(true, Name + ": Okay");
}

public static void Main(
#if !LIB
public static void MainOld(
string[] args)
{
ITest test = new EncryptedPrivateKeyInfoTest();
ITestResult result = test.Perform();

Console.WriteLine(result);
}
#endif

[Test]
public void TestFunction()
Expand Down
6 changes: 3 additions & 3 deletions crypto/test/src/asn1/test/EqualsAndHashCodeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ public override string Name
{
get { return "EqualsAndHashCode"; }
}

public static void Main(
#if !LIB
public static void MainOld(
string[] args)
{
RunTest(new EqualsAndHashCodeTest());
}

#endif
[Test]
public void TestFunction()
{
Expand Down
5 changes: 3 additions & 2 deletions crypto/test/src/asn1/test/EssCertIDv2UnitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ public override void PerformTest()

EssCertIDv2.GetInstance(asn1Object);
}
public static void Main(
#if !LIB
public static void MainOld(
string[] args)
{
RunTest(new EssCertIDv2UnitTest());
}
#endif

[Test]
public void TestFunction()
Expand Down
5 changes: 3 additions & 2 deletions crypto/test/src/asn1/test/GeneralNameTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,13 @@ public override void PerformTest()
Fail("ipv6h failed");
}
}

public static void Main(
#if !LIB
public static void MainOld(
string[] args)
{
RunTest(new GeneralNameTest());
}
#endif

[Test]
public void TestFunction()
Expand Down
7 changes: 4 additions & 3 deletions crypto/test/src/asn1/test/GeneralizedTimeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ private string CalculateGmtOffset(
char sign = '+';

// Note: GetUtcOffset incorporates Daylight Savings offset
TimeSpan offset = TimeZone.CurrentTimeZone.GetUtcOffset(date);
TimeSpan offset = TimeZoneInfo.Local.GetUtcOffset(date);
if (offset.CompareTo(TimeSpan.Zero) < 0)
{
sign = '-';
Expand All @@ -213,12 +213,13 @@ private string Convert(int time)

return time.ToString();
}

public static void Main(
#if !LIB
public static void MainOld(
string[] args)
{
RunTest(new GeneralizedTimeTest());
}
#endif

[Test]
public void TestFunction()
Expand Down
5 changes: 3 additions & 2 deletions crypto/test/src/asn1/test/GenerationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,13 @@ public override string Name
{
get { return "Generation"; }
}

public static void Main(
#if !LIB
public static void MainOld(
string[] args)
{
RunTest(new GenerationTest());
}
#endif

[Test]
public void TestFunction()
Expand Down
5 changes: 3 additions & 2 deletions crypto/test/src/asn1/test/InputStreamTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,13 @@ public override void PerformTest()
}
}
}

public static void Main(
#if !LIB
public static void MainOld(
string[] args)
{
RunTest(new InputStreamTest());
}
#endif

[Test]
public void TestFunction()
Expand Down
Loading

0 comments on commit dd1b0b2

Please sign in to comment.