Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

Commit

Permalink
fix: Add IImageFolderViewModel to DI for testing ApplicationViewModel
Browse files Browse the repository at this point in the history
  • Loading branch information
StanleyGoldman committed Jan 20, 2019
1 parent 6e443af commit 726909c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion SonOfPicasso.UI.Tests/Extensions/TestExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using SonOfPicasso.Core.Scheduling;
using SonOfPicasso.Testing.Common;
using SonOfPicasso.Testing.Common.Services;
using SonOfPicasso.UI.Interfaces;
using SonOfPicasso.UI.Scheduling;
using SonOfPicasso.UI.Tests.Scheduling;
using SonOfPicasso.UI.ViewModels;
Expand All @@ -18,16 +19,19 @@ public static ApplicationViewModel CreateApplicationViewModel<T>(this TestsBase<
IFileSystem fileSystem = null,
ISharedCache sharedCache = null,
IImageLocationService imageLocationService = null,
ISchedulerProvider schedulerProvider = null)
ISchedulerProvider schedulerProvider = null,
IImageFolderViewModel imageFolderViewModel = null)
{
fileSystem = fileSystem ?? new MockFileSystem();
imageLocationService = imageLocationService ?? Substitute.For<IImageLocationService>();
schedulerProvider = schedulerProvider ?? new TestSchedulerProvider();
imageFolderViewModel = imageFolderViewModel ?? new ImageFolderViewModel();

var serviceCollection = databaseReaderTests.GetServiceCollection()
.AddSingleton(fileSystem)
.AddSingleton(schedulerProvider)
.AddSingleton(imageLocationService)
.AddSingleton(imageFolderViewModel)
.AddSingleton(typeof(ApplicationViewModel));

if (sharedCache != null)
Expand Down

0 comments on commit 726909c

Please sign in to comment.