public void HasErrorChecksum() { string workingDirectory = $"{AppDomain.CurrentDomain.BaseDirectory}\\TestData\\Noark5\\StructureChecksums\\errors"; var archive = new Base.ArchiveBuilder() .WithArchiveType(ArchiveType.Noark5) .WithWorkingDirectoryRoot(workingDirectory) .WithWorkingDirectoryExternalContent(workingDirectory + "\\content") .Build(); var validateAddmlDataobjectsChecksums = new N5_02_ValidateAddmlDataobjectsChecksums(); validateAddmlDataobjectsChecksums.Test(archive); var testRun = validateAddmlDataobjectsChecksums.GetTestRun(); testRun.Results.Count.Should().Be(1); testRun.IsSuccess().Should().BeFalse(); }
public void ShouldValidateThatAllChecksumsAreCorrect() { string workingDirectory = $"{AppDomain.CurrentDomain.BaseDirectory}\\TestData\\Noark5\\StructureChecksums\\correct"; var archive = new Base.ArchiveBuilder() .WithArchiveType(ArchiveType.Noark5) .WithWorkingDirectoryRoot(workingDirectory) .WithWorkingDirectoryExternalContent(workingDirectory + "\\content") .Build(); var validateAddmlDataobjectsChecksums = new N5_02_ValidateAddmlDataobjectsChecksums(); validateAddmlDataobjectsChecksums.Test(archive); var testRun = validateAddmlDataobjectsChecksums.GetTestRun(); testRun.Results.Count.Should().Be(9); testRun.IsSuccess().Should().BeTrue(); foreach (var testResult in testRun.Results) { _output.WriteLine(testResult.Location + ": " + testResult.Message); } }