private TestRun RunTest() { Archive archive = new Core.ArchiveBuilder().WithWorkingDirectoryRoot("c:\\temp").Build(); var validateXmlWithSchema = new ValidateXmlWithSchema(new ArchiveContentMockReader(_archiveContent, _archiveStructureContent)); validateXmlWithSchema.Test(archive); return(validateXmlWithSchema.GetTestRun()); }
private TestRun RunTest() { Archive archive = new Core.ArchiveBuilder().WithWorkingDirectoryRoot("c:\\temp").Build(); var validateXmlWithSchema = new ValidateXmlWithSchema(); validateXmlWithSchema.Test(archive); return(validateXmlWithSchema.GetTestRun()); }
private TestRun RunTest() { var tmpFolder = new DirectoryInfo(Path.GetTempPath() + "/" + Path.GetRandomFileName()); tmpFolder.Create(); Archive archive = new Core.ArchiveBuilder().WithWorkingDirectoryRoot(tmpFolder.FullName).Build(); var validateXmlWithSchema = new ValidateXmlWithSchema(); validateXmlWithSchema.Test(archive); return(validateXmlWithSchema.GetTestRun()); }
public void HasErrorChecksum() { string workingDirectory = $"{Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)}\\TestData\\Noark5\\StructureChecksums\\errors"; var archive = new Core.ArchiveBuilder() .WithArchiveType(ArchiveType.Noark5) .WithWorkingDirectoryRoot(workingDirectory) .WithWorkingDirectoryExternalContent(workingDirectory + "\\content") .Build(); var validateAddmlDataobjectsChecksums = new ValidateAddmlDataobjectsChecksums(); System.Exception ex = Assert.Throws <ArkadeException>(() => validateAddmlDataobjectsChecksums.Test(archive)); }
public void ShouldValidateThatAllChecksumsAreCorrect() { string workingDirectory = $"{Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)}\\TestData\\Noark5\\StructureChecksums\\correct"; var archive = new Core.ArchiveBuilder() .WithArchiveType(ArchiveType.Noark5) .WithWorkingDirectoryRoot(workingDirectory) .WithWorkingDirectoryExternalContent(workingDirectory + "\\content") .Build(); var validateAddmlDataobjectsChecksums = new ValidateAddmlDataobjectsChecksums(); validateAddmlDataobjectsChecksums.Test(archive); var testRun = validateAddmlDataobjectsChecksums.GetTestRun(); testRun.Results.Count.Should().Be(2); testRun.IsSuccess().Should().BeTrue(); foreach (var testResult in testRun.Results) { _output.WriteLine(testResult.Location + ": " + testResult.Message); } }