public void returns_all_existing_versions_of_the_same_chunk_in_descending_order_of_versions() { File.Create(GetFilePathFor("foo")).Close(); File.Create(GetFilePathFor("bla")).Close(); File.Create(GetFilePathFor("chunk-000001.000000")).Close(); File.Create(GetFilePathFor("chunk-000002.000000")).Close(); File.Create(GetFilePathFor("chunk-000003.000000")).Close(); File.Create(GetFilePathFor("chunk-000005.000000")).Close(); File.Create(GetFilePathFor("chunk-000005.000007")).Close(); File.Create(GetFilePathFor("chunk-000005.000002")).Close(); File.Create(GetFilePathFor("chunk-000005.000005")).Close(); var strategy = new VersionedPatternFileNamingStrategy(PathName, "chunk-"); var versions = strategy.GetAllVersionsFor(5); Assert.AreEqual(4, versions.Length); Assert.AreEqual(GetFilePathFor("chunk-000005.000007"), versions[0]); Assert.AreEqual(GetFilePathFor("chunk-000005.000005"), versions[1]); Assert.AreEqual(GetFilePathFor("chunk-000005.000002"), versions[2]); Assert.AreEqual(GetFilePathFor("chunk-000005.000000"), versions[3]); }
public void does_not_return_temp_file_that_is_named_as_chunk() { File.Create(GetFilePathFor("chunk-000000.000000.tmp")).Close(); var strategy = new VersionedPatternFileNamingStrategy(PathName, "chunk-"); var tempFiles = strategy.GetAllVersionsFor(0); Assert.AreEqual(0, tempFiles.Length); }