public void NoVersions() { var fileSystem = SetupNoVersions(); SemVerUtil semVerUtil = new SemVerUtil(fileSystem); semVerUtil.Initialize(@"C:\", "Ver"); FileSemVer fileSemVer = semVerUtil.DirectoryMostRecentVersion(); Assert.IsNull(fileSemVer); fileSemVer = semVerUtil.DirectoryOldestVersion(); Assert.IsNull(fileSemVer); List <FileSemVer> lists = semVerUtil.DirectoryNewestVersions(4); Assert.IsNull(lists); lists = semVerUtil.DirectoryOldestVersions(5); Assert.IsNull(lists); lists = semVerUtil.OldestWithMin(2); Assert.AreEqual(0, lists.Count); }
public void NotInitializedThrowsInOldestVersion() { MockFileSystem fileSystem = SetupFileSystem(); SemVerUtil semverUtil = new SemVerUtil(fileSystem); Assert.Throws <ApplicationException>(() => semverUtil.DirectoryOldestVersion()); }
public void OldestVersion() { var fileSystem = SetupFileSystem(); SemVerUtil semVerUtil = new SemVerUtil(fileSystem); semVerUtil.Initialize(@"C:\", "Ver"); FileSemVer fileSemVer = semVerUtil.DirectoryOldestVersion(); Assert.AreEqual(FIRST_VERSION, fileSemVer.Version, "A10:"); }