Refactor media import handlers to utilize ManualInboxTaker for improved functionality
Updated the ImportManualInboxCommandHandler and ImportMoviesCommandHandler to replace direct storage interactions with the ManualInboxTaker, streamlining the import process. This change enhances code clarity and maintains consistency across media import functionalities. Additionally, refactored related tests to accommodate the new handler structure, ensuring robust testing of the import logic.
This commit is contained in:
@@ -2,6 +2,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using NSubstitute;
|
||||
using TeleWave.Application.Common.Interfaces;
|
||||
using TeleWave.Application.Library.Genres;
|
||||
using TeleWave.Application.Media.ManualInbox;
|
||||
using TeleWave.Application.Media.MovieImport;
|
||||
using TeleWave.Application.Metadata;
|
||||
using TeleWave.Application.Tests.Support;
|
||||
@@ -64,10 +65,12 @@ public class ImportMoviesTests
|
||||
new GenreMatcher(db)
|
||||
);
|
||||
|
||||
var result = await new ImportMoviesCommandHandler(db, storage, queue, applier).Handle(
|
||||
new ImportMoviesCommand(items, Provider),
|
||||
CancellationToken.None
|
||||
);
|
||||
var result = await new ImportMoviesCommandHandler(
|
||||
db,
|
||||
new ManualInboxTaker(db, storage),
|
||||
queue,
|
||||
applier
|
||||
).Handle(new ImportMoviesCommand(items, Provider), CancellationToken.None);
|
||||
|
||||
Assert.True(result.IsSuccess);
|
||||
await db.SaveChangesAsync(CancellationToken.None);
|
||||
|
||||
Reference in New Issue
Block a user