Skip to content

Commit

Permalink
added xunit test project for #22
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxRev-Dev committed Jul 13, 2020
1 parent e1c4cfd commit 70ab3da
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 39 deletions.
45 changes: 45 additions & 0 deletions test/GdalCore-XUnit/CommonTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using MaxRev.Gdal.Core;
using OSGeo.GDAL;
using Xunit;
using Xunit.Abstractions;

namespace GdalCore_XUnit
{
public class CommonTests
{
private readonly ITestOutputHelper _outputHelper;

public CommonTests(ITestOutputHelper outputHelper)
{
_outputHelper = outputHelper;
GdalBase.ConfigureAll();
}

[Fact]
public void AllDriversAvailable()
{
// list of common drivers
var drivers = new[]
{
"hdf4", "hdf5", "gtiff", "aaigrid", "adrg", "airsar", "arg", "blx", "bmp", "bsb", "cals", "ceos",
"coasp", "cosar", "ctg", "dimap", "dted", "e00grid", "elas", "ers", "fit", "gff", "gxf", "hf2",
"idrisi", "ignfheightasciigrid", "ilwis", "ingr", "iris", "jaxapalsar", "jdem", "kmlsuperoverlay",
"l1b", "leveller", "map", "mrf", "msgn", "ngsgeoid", "nitf", "pds", "prf", "r", "rmf", "rs2",
"safe", "saga", "sdts", "sentinel2", "sgi", "sigdem", "srtmhgt", "terragen", "til", "tsx",
"usgsdem", "xpm", "xyz", "zmap", "rik", "ozi", "grib", "rasterlite", "mbtiles", "pdf", "aeronavfaa",
"arcgen", "bna", "cad", "csv", "dgn", "dxf", "edigeo", "geoconcept", "georss", "gml", "gpsbabel",
"gpx", "htf", "jml", "mvt", "openair", "openfilegdb", "pgdump", "rec", "s57", "segukooa", "segy",
"selafin", "ESRI Shapefile", "sua", "svg", "sxf", "tiger", "vdv", "wasp", "xplane", "idrisi", "pds",
"sdts", "gpkg", "vfk", "osm"
};

foreach (var driver in drivers)
{
var driverByName = Gdal.GetDriverByName(driver);
_outputHelper.WriteLine(
driverByName != default ? $"{driver} loaded successfully" : $"Failed to load {driver}");
}

}
}
}
27 changes: 27 additions & 0 deletions test/GdalCore-XUnit/GdalCore-XUnit.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>GdalCore_XUnit</RootNamespace>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="1.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\GdalCoreTest\GdalCoreTest.csproj" />
</ItemGroup>

</Project>
88 changes: 49 additions & 39 deletions test/GdalCoreTest.sln
Original file line number Diff line number Diff line change
@@ -1,39 +1,49 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29102.190
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GdalCoreTest", "GdalCoreTest\GdalCoreTest.csproj", "{D14783C5-E098-4020-9DBD-FE31B773A48C}"
EndProject
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{E82FBDCE-730C-4766-A90B-B673983C6281}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D14783C5-E098-4020-9DBD-FE31B773A48C}.Debug|Any CPU.ActiveCfg = Debug|x64
{D14783C5-E098-4020-9DBD-FE31B773A48C}.Debug|x64.ActiveCfg = Debug|x64
{D14783C5-E098-4020-9DBD-FE31B773A48C}.Debug|x64.Build.0 = Debug|x64
{D14783C5-E098-4020-9DBD-FE31B773A48C}.Release|Any CPU.ActiveCfg = Release|x64
{D14783C5-E098-4020-9DBD-FE31B773A48C}.Release|x64.ActiveCfg = Release|x64
{D14783C5-E098-4020-9DBD-FE31B773A48C}.Release|x64.Build.0 = Release|x64
{E82FBDCE-730C-4766-A90B-B673983C6281}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E82FBDCE-730C-4766-A90B-B673983C6281}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E82FBDCE-730C-4766-A90B-B673983C6281}.Debug|x64.ActiveCfg = Debug|Any CPU
{E82FBDCE-730C-4766-A90B-B673983C6281}.Debug|x64.Build.0 = Debug|Any CPU
{E82FBDCE-730C-4766-A90B-B673983C6281}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E82FBDCE-730C-4766-A90B-B673983C6281}.Release|Any CPU.Build.0 = Release|Any CPU
{E82FBDCE-730C-4766-A90B-B673983C6281}.Release|x64.ActiveCfg = Release|Any CPU
{E82FBDCE-730C-4766-A90B-B673983C6281}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {82061154-290D-4ECC-A9DE-0694AD04AA35}
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29102.190
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GdalCoreTest", "GdalCoreTest\GdalCoreTest.csproj", "{D14783C5-E098-4020-9DBD-FE31B773A48C}"
EndProject
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{E82FBDCE-730C-4766-A90B-B673983C6281}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GdalCore-XUnit", "GdalCore-XUnit\GdalCore-XUnit.csproj", "{1262702F-7623-4AB8-AEE6-ABD75C984ED6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D14783C5-E098-4020-9DBD-FE31B773A48C}.Debug|Any CPU.ActiveCfg = Debug|x64
{D14783C5-E098-4020-9DBD-FE31B773A48C}.Debug|x64.ActiveCfg = Debug|x64
{D14783C5-E098-4020-9DBD-FE31B773A48C}.Debug|x64.Build.0 = Debug|x64
{D14783C5-E098-4020-9DBD-FE31B773A48C}.Release|Any CPU.ActiveCfg = Release|x64
{D14783C5-E098-4020-9DBD-FE31B773A48C}.Release|x64.ActiveCfg = Release|x64
{D14783C5-E098-4020-9DBD-FE31B773A48C}.Release|x64.Build.0 = Release|x64
{E82FBDCE-730C-4766-A90B-B673983C6281}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E82FBDCE-730C-4766-A90B-B673983C6281}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E82FBDCE-730C-4766-A90B-B673983C6281}.Debug|x64.ActiveCfg = Debug|Any CPU
{E82FBDCE-730C-4766-A90B-B673983C6281}.Debug|x64.Build.0 = Debug|Any CPU
{E82FBDCE-730C-4766-A90B-B673983C6281}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E82FBDCE-730C-4766-A90B-B673983C6281}.Release|Any CPU.Build.0 = Release|Any CPU
{E82FBDCE-730C-4766-A90B-B673983C6281}.Release|x64.ActiveCfg = Release|Any CPU
{E82FBDCE-730C-4766-A90B-B673983C6281}.Release|x64.Build.0 = Release|Any CPU
{1262702F-7623-4AB8-AEE6-ABD75C984ED6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1262702F-7623-4AB8-AEE6-ABD75C984ED6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1262702F-7623-4AB8-AEE6-ABD75C984ED6}.Debug|x64.ActiveCfg = Debug|Any CPU
{1262702F-7623-4AB8-AEE6-ABD75C984ED6}.Debug|x64.Build.0 = Debug|Any CPU
{1262702F-7623-4AB8-AEE6-ABD75C984ED6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1262702F-7623-4AB8-AEE6-ABD75C984ED6}.Release|Any CPU.Build.0 = Release|Any CPU
{1262702F-7623-4AB8-AEE6-ABD75C984ED6}.Release|x64.ActiveCfg = Release|Any CPU
{1262702F-7623-4AB8-AEE6-ABD75C984ED6}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {82061154-290D-4ECC-A9DE-0694AD04AA35}
EndGlobalSection
EndGlobal

0 comments on commit 70ab3da

Please sign in to comment.