mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-12 08:16:05 -07:00
Fixed tests
This commit is contained in:
parent
05e4c313bf
commit
dd46f08f8b
2 changed files with 5 additions and 5 deletions
|
@ -25,15 +25,11 @@
|
||||||
// ************************************************************************/
|
// ************************************************************************/
|
||||||
#endregion
|
#endregion
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
|
||||||
|
|
||||||
using Nancy;
|
using Nancy;
|
||||||
|
|
||||||
using PlexRequests.UI.Modules;
|
|
||||||
|
|
||||||
namespace PlexRequests.UI.Tests
|
namespace PlexRequests.UI.Tests
|
||||||
{
|
{
|
||||||
public class TestRootPathProvider : IRootPathProvider
|
public class TestRootPathProvider : IRootPathProvider
|
||||||
|
@ -42,7 +38,6 @@ namespace PlexRequests.UI.Tests
|
||||||
|
|
||||||
public string GetRootPath()
|
public string GetRootPath()
|
||||||
{
|
{
|
||||||
//return @"C:\Applications\51\DeliveryDateCalculator\StandAndDeliver\Views\Home\";
|
|
||||||
if (!string.IsNullOrEmpty(_CachedRootPath))
|
if (!string.IsNullOrEmpty(_CachedRootPath))
|
||||||
return _CachedRootPath;
|
return _CachedRootPath;
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
// ************************************************************************/
|
// ************************************************************************/
|
||||||
#endregion
|
#endregion
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
using Moq;
|
using Moq;
|
||||||
|
|
||||||
|
@ -50,6 +51,7 @@ namespace PlexRequests.UI.Tests
|
||||||
{
|
{
|
||||||
private Mock<ISettingsService<AuthenticationSettings>> AuthMock { get; set; }
|
private Mock<ISettingsService<AuthenticationSettings>> AuthMock { get; set; }
|
||||||
private Mock<ISettingsService<PlexRequestSettings>> PlexRequestMock { get; set; }
|
private Mock<ISettingsService<PlexRequestSettings>> PlexRequestMock { get; set; }
|
||||||
|
private Mock<ISettingsService<LandingPageSettings>> LandingPageMock { get; set; }
|
||||||
private ConfigurableBootstrapper Bootstrapper { get; set; }
|
private ConfigurableBootstrapper Bootstrapper { get; set; }
|
||||||
private Mock<IPlexApi> PlexMock { get; set; }
|
private Mock<IPlexApi> PlexMock { get; set; }
|
||||||
|
|
||||||
|
@ -58,14 +60,17 @@ namespace PlexRequests.UI.Tests
|
||||||
{
|
{
|
||||||
AuthMock = new Mock<ISettingsService<AuthenticationSettings>>();
|
AuthMock = new Mock<ISettingsService<AuthenticationSettings>>();
|
||||||
PlexMock = new Mock<IPlexApi>();
|
PlexMock = new Mock<IPlexApi>();
|
||||||
|
LandingPageMock = new Mock<ISettingsService<LandingPageSettings>>();
|
||||||
PlexRequestMock = new Mock<ISettingsService<PlexRequestSettings>>();
|
PlexRequestMock = new Mock<ISettingsService<PlexRequestSettings>>();
|
||||||
PlexRequestMock.Setup(x => x.GetSettings()).Returns(new PlexRequestSettings());
|
PlexRequestMock.Setup(x => x.GetSettings()).Returns(new PlexRequestSettings());
|
||||||
|
PlexRequestMock.Setup(x => x.GetSettingsAsync()).Returns(Task.FromResult(new PlexRequestSettings()));
|
||||||
Bootstrapper = new ConfigurableBootstrapper(with =>
|
Bootstrapper = new ConfigurableBootstrapper(with =>
|
||||||
{
|
{
|
||||||
with.Module<UserLoginModule>();
|
with.Module<UserLoginModule>();
|
||||||
with.Dependency(PlexRequestMock.Object);
|
with.Dependency(PlexRequestMock.Object);
|
||||||
with.Dependency(AuthMock.Object);
|
with.Dependency(AuthMock.Object);
|
||||||
with.Dependency(PlexMock.Object);
|
with.Dependency(PlexMock.Object);
|
||||||
|
with.Dependency(LandingPageMock.Object);
|
||||||
with.RootPathProvider<TestRootPathProvider>();
|
with.RootPathProvider<TestRootPathProvider>();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue