public ReleaseInformation GetReleaseInfo(string productName, string os, string architecture, string version) { try { var path = GenerateArtifactPath(productName, os, architecture, version); if (Directory.Exists(path)) { var dir = new DirectoryInfo(path); var files = dir.GetFiles(); var deploymentMetaInfo = GetDeploymentMetaInfo(files); var releaseNotesFileName = Path.Combine(path, deploymentMetaInfo.ReleaseNotesFileName); return(new ReleaseInformation { ReleaseNotes = ReleaseNotes.FromJsonFile(releaseNotesFileName), ReleaseDate = deploymentMetaInfo.ReleaseDate }); } //The artifact directory (thus the specified artifact) does not exist. return(null); } catch (Exception e) { logger.LogCritical(e.Message); throw; } }
public void DeserializeReleaseNotes() { var parsedReleaseNotes = ReleaseNotes.FromJsonFile(Path.Combine(ProjectDirectory, "TestData", "testReleaseNotes.json")); parsedReleaseNotes.Should().BeEquivalentTo(ExpectedReleaseNotes); }