public void WrongVersionNumberGivesHelpfulMessage() { string path = TempOxesFiles.MinimalVersion107File(null); string errors = ValidateAndDelete(path, false); Assert.IsTrue(errors.Contains("This file claims to be version")); }
public void MigrateToLatestVersion_IsOldVersion_ReturnsDifferentPath() { string path = null; string pathMigrated = null; try { path = TempOxesFiles.MinimalVersion107File(null); pathMigrated = Migrator.MigrateToLatestVersion(path); Assert.AreNotEqual(path, pathMigrated); string errors = Validator.GetAnyValidationErrors(pathMigrated); Assert.IsNull(errors); } finally { if (!String.IsNullOrEmpty(path)) { FileUtils.Delete(path); } if (!String.IsNullOrEmpty(pathMigrated) && pathMigrated != path) { FileUtils.Delete(pathMigrated); } } }
public void MigrateToLatestVersion_HasCurrentVersion_Throws() { string path = null; try { path = TempOxesFiles.MinimalValidFile(null); Migrator.MigrateToLatestVersion(path); } finally { if (!String.IsNullOrEmpty(path)) { FileUtils.Delete(path); } } }
public void IsMigrationNeeded_Latest_ReturnsFalse() { string path = null; try { path = TempOxesFiles.MinimalValidFile(null); Assert.IsFalse(Migrator.IsMigrationNeeded(path)); } finally { if (!String.IsNullOrEmpty(path)) { FileUtils.Delete(path); } } }
public void Validate_TinyBadFile_Fails() { string path = TempOxesFiles.BadMinimalFile(null); ValidateAndDelete(path, false); }
public void Validate_MinimalFile_Succeeds() { string path = TempOxesFiles.MinimalValidFile(null); ValidateAndDelete(path, true); }
public void Validate_EmptyFile_Fails() { string path = TempOxesFiles.EmptyOxesFile(null); ValidateAndDelete(path, false); }