Skip to content

Commit

Permalink
add resolver test
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsmits committed Apr 30, 2024
1 parent 77dd5d9 commit 0299005
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,37 @@ private static Validator buildValidator(string suiteName, IExternalReferenceReso

return new Validator(profileSource, terminologySource, resolver);
}


[TestMethod]
public async Task CheckResolver()
{
var sources = new List<IAsyncResourceResolver>();

var suiteDirectory = getSuiteDirectory("issue-165");
var conformanceDirectory = Path.Combine(suiteDirectory, "conformance");
if (Directory.Exists(conformanceDirectory))
sources.Add(new DirectorySource(conformanceDirectory));

//var externalPackagesManifest = Path.Combine(suiteDirectory, PackageFileNames.MANIFEST);
//if (File.Exists(externalPackagesManifest))
// sources.Add();

var usecasePackageSource = NpmPackageHelper.Create(M.ModelInfo.ModelInspector, suiteDirectory).Result;

var packageSource = FhirPackageSource.CreateCorePackageSource(
M.ModelInfo.ModelInspector, RELEASE,
"https://packages.simplifier.net")!;
sources.Add(packageSource);

var combinedSource = new MultiResolver(sources);
var profileSource = new SnapshotSource(new CachedResolver(combinedSource));


var result = await usecasePackageSource.ResolveByCanonicalUriAsync("http://fhir.de/StructureDefinition/gender-amtlich-de|0.9.13");

result.Should().NotBeNull();
}
}

internal class NpmPackageHelper
Expand Down

0 comments on commit 0299005

Please sign in to comment.