-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
89 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,33 @@ | ||
using System; | ||
using System.IO; | ||
using System.Threading.Tasks; | ||
using starsky.foundation.platform.Enums; | ||
using starsky.foundation.platform.Thumbnails; | ||
using starsky.foundation.storage.Interfaces; | ||
using starsky.foundation.storage.Storage; | ||
using starsky.foundation.video.Process; | ||
using starsky.foundation.video.Process.Interfaces; | ||
using starskytest.FakeCreateAn; | ||
|
||
namespace starskytest.FakeMocks; | ||
|
||
public class FakeIVideoProcess : IVideoProcess | ||
public class FakeIVideoProcess(ISelectorStorage selectorStorage) : IVideoProcess | ||
{ | ||
public Task<VideoResult> RunVideo(string subPath, string? beforeFileHash, | ||
private readonly IStorage _thumbnailStorage = | ||
selectorStorage.Get(SelectorStorage.StorageServices.Thumbnail); | ||
|
||
public async Task<VideoResult> RunVideo(string subPath, string? beforeFileHash, | ||
VideoProcessTypes type) | ||
{ | ||
return Task.FromResult(new VideoResult(true)); | ||
ArgumentNullException.ThrowIfNull(beforeFileHash); | ||
|
||
var thumbnailName = ThumbnailNameHelper.Combine(beforeFileHash, ThumbnailSize.ExtraLarge, | ||
ThumbnailImageFormat.jpg); | ||
|
||
await _thumbnailStorage.WriteStreamAsync(new MemoryStream([.. CreateAnImage.Bytes]), | ||
thumbnailName | ||
); | ||
|
||
return new VideoResult(true, thumbnailName, "Mocked"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters