Skip to content

Commit

Permalink
Move gdal initialization to assemblyInitialize
Browse files Browse the repository at this point in the history
  • Loading branch information
tschumpr committed Apr 30, 2024
1 parent 7be71f9 commit 809457d
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 20 deletions.
10 changes: 0 additions & 10 deletions Geodatenbezug.Test/GdalAssert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@ namespace Geodatenbezug;
/// </summary>
internal static class GdalAssert
{
/// <summary>
/// Initializes the GDAL environment.
/// </summary>
internal static void Initialize()
{
GdalBase.ConfigureAll();
Ogr.RegisterAll();
Ogr.UseExceptions();
}

/// <summary>
/// Asserts that the result layer has the expected fields.
/// </summary>
Expand Down
16 changes: 16 additions & 0 deletions Geodatenbezug.Test/Initialize.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using MaxRev.Gdal.Core;
using OSGeo.OGR;

namespace Geodatenbezug;

[TestClass]
public sealed class Initialize
{
[AssemblyInitialize]
public static void AssemblyInitialize(TestContext testContext)
{
GdalBase.ConfigureAll();
Ogr.RegisterAll();
Ogr.UseExceptions();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ public class BewirtschaftungseinheitProcessorTest
[TestInitialize]
public void Initialize()
{
GdalAssert.Initialize();

loggerMock = new Mock<ILogger<Processor>>(MockBehavior.Strict);
geodiensteApiMock = new Mock<IGeodiensteApi>(MockBehavior.Strict);
azureStorageMock = new Mock<IAzureStorage>(MockBehavior.Strict);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ public class BiodiversitaetsfoerderflaechenProcessorTest
[TestInitialize]
public void Initialize()
{
GdalAssert.Initialize();

loggerMock = new Mock<ILogger<Processor>>(MockBehavior.Strict);
geodiensteApiMock = new Mock<IGeodiensteApi>(MockBehavior.Strict);
azureStorageMock = new Mock<IAzureStorage>(MockBehavior.Strict);
Expand Down
2 changes: 0 additions & 2 deletions Geodatenbezug.Test/Processors/PerimeterLnSfProcessorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ public class PerimeterLnSfProcessorTest
[TestInitialize]
public void Initialize()
{
GdalAssert.Initialize();

loggerMock = new Mock<ILogger<Processor>>(MockBehavior.Strict);
geodiensteApiMock = new Mock<IGeodiensteApi>(MockBehavior.Strict);
azureStorageMock = new Mock<IAzureStorage>(MockBehavior.Strict);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ public class PerimeterTerrassenrebenProcessorTest
[TestInitialize]
public void Initialize()
{
GdalAssert.Initialize();

loggerMock = new Mock<ILogger<Processor>>(MockBehavior.Strict);
geodiensteApiMock = new Mock<IGeodiensteApi>(MockBehavior.Strict);
azureStorageMock = new Mock<IAzureStorage>(MockBehavior.Strict);
Expand Down
2 changes: 0 additions & 2 deletions Geodatenbezug.Test/Processors/RebbaukatasterProcessorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ public class RebbaukatasterProcessorTest
[TestInitialize]
public void Initialize()
{
GdalAssert.Initialize();

loggerMock = new Mock<ILogger<Processor>>(MockBehavior.Strict);
geodiensteApiMock = new Mock<IGeodiensteApi>(MockBehavior.Strict);
azureStorageMock = new Mock<IAzureStorage>(MockBehavior.Strict);
Expand Down

0 comments on commit 809457d

Please sign in to comment.