Skip to content

Commit

Permalink
#1803 fix typo // fix be tests
Browse files Browse the repository at this point in the history
  • Loading branch information
qdraw committed Nov 8, 2024
1 parent 6a9e8fa commit f0723f1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static string GetFileName(string filePath,

/// <summary>
/// Regex to get FileName Without Extension
/// pre compiled regex
/// pre compiled regular expression
/// Regex.Match
/// </summary>
/// <returns>Regex object</returns>
Expand All @@ -82,7 +82,7 @@ public static string GetFileNameWithoutExtension(string filePath)

/// <summary>
/// Regex to File Extension Without Dot
/// pre compiled regex
/// pre compiled regular expression
/// Regex.Match
/// </summary>
/// <returns>Regex object</returns>
Expand Down Expand Up @@ -110,7 +110,7 @@ public static string GetFileExtensionWithoutDot(string filename)

/// <summary>
/// Return UNIX style parent paths back
/// Get Parent Regex
/// Get Parent regular expression
/// unescaped regex: /.+(?=\/[^/]+$)/
/// </summary>
/// <param name="filePath">unix style subPath</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,27 +94,18 @@ await query.GetObjectsByFilePathAsync(new List<string> { $"{dirName}/test1.jpg"
[DataRow(false)]
public async Task GetObjectsByFilePathAsync_collectionTrue_HomeItem(bool isCollection)
{
var query = new Query(CreateNewScope().CreateScope().ServiceProvider
.GetRequiredService<ApplicationDbContext>(), new AppSettings(), CreateNewScope(),
new FakeIWebLogger(), _memoryCache);

const string dirName = "/";
query.AddCacheParentItem(dirName,
new List<FileIndexItem>
{
new(dirName),
new($"{dirName}/test1.jpg"),
new($"{dirName}/test1.dng"),
new($"{dirName}/test2.jpg"),
new($"{dirName}/test2.dng")
});
var item = new FileIndexItem(dirName);
await _query.AddItemAsync(item);

var result =
await query.GetObjectsByFilePathAsync(new List<string> { dirName },
await _query.GetObjectsByFilePathAsync(new List<string> { dirName },
isCollection);

Assert.AreEqual(1, result.Count);
Console.WriteLine();
Assert.AreEqual(dirName, result[0].FilePath);

await _query.RemoveItemAsync(item);
}

[TestMethod]
Expand All @@ -124,7 +115,7 @@ public async Task GetObjectsByFilePathAsync_notImplicitSet_cache_collectionTrue(
.GetRequiredService<ApplicationDbContext>(), new AppSettings(), CreateNewScope(),
new FakeIWebLogger(), _memoryCache);

var dirName = "/implicit_item_02";
const string dirName = "/implicit_item_02";
await query.AddRangeAsync(new List<FileIndexItem>
{
new($"{dirName}/test1.jpg"),
Expand Down

0 comments on commit f0723f1

Please sign in to comment.