9e7f26f7a6
* Introduce ModelCacheManager to manage cache and sizes and deletions * move and abstract * add tests and format * Update src/Speckle.Sdk/Caching/ModelCacheManager.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Clean up --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
23 lines
677 B
C#
23 lines
677 B
C#
using Speckle.InterfaceGenerator;
|
|
|
|
namespace Speckle.Sdk.Caching;
|
|
|
|
/// <summary>
|
|
/// This mocks away the file system operations for testing purposes.
|
|
/// </summary>
|
|
[GenerateAutoInterface]
|
|
public class FileSystem : IFileSystem
|
|
{
|
|
public bool DirectoryExists(string path) => Directory.Exists(path);
|
|
|
|
public void CreateDirectory(string path) => Directory.CreateDirectory(path);
|
|
|
|
public IEnumerable<string> EnumerateFiles(string path) => Directory.EnumerateFiles(path);
|
|
|
|
public void DeleteFile(string path) => File.Delete(path);
|
|
|
|
public long GetFileSize(string path) => new FileInfo(path).Length;
|
|
|
|
public string Combine(params string[] paths) => Path.Combine(paths);
|
|
}
|