Fixed tests

pull/332/head
tidusjar 9 years ago
parent 05e4c313bf
commit dd46f08f8b

@ -25,15 +25,11 @@
// ************************************************************************/
#endregion
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using Nancy;
using PlexRequests.UI.Modules;
namespace PlexRequests.UI.Tests
{
public class TestRootPathProvider : IRootPathProvider
@ -42,7 +38,6 @@ namespace PlexRequests.UI.Tests
public string GetRootPath()
{
//return @"C:\Applications\51\DeliveryDateCalculator\StandAndDeliver\Views\Home\";
if (!string.IsNullOrEmpty(_CachedRootPath))
return _CachedRootPath;

@ -25,6 +25,7 @@
// ************************************************************************/
#endregion
using System.Collections.Generic;
using System.Threading.Tasks;
using Moq;
@ -50,6 +51,7 @@ namespace PlexRequests.UI.Tests
{
private Mock<ISettingsService<AuthenticationSettings>> AuthMock { get; set; }
private Mock<ISettingsService<PlexRequestSettings>> PlexRequestMock { get; set; }
private Mock<ISettingsService<LandingPageSettings>> LandingPageMock { get; set; }
private ConfigurableBootstrapper Bootstrapper { get; set; }
private Mock<IPlexApi> PlexMock { get; set; }
@ -58,14 +60,17 @@ namespace PlexRequests.UI.Tests
{
AuthMock = new Mock<ISettingsService<AuthenticationSettings>>();
PlexMock = new Mock<IPlexApi>();
LandingPageMock = new Mock<ISettingsService<LandingPageSettings>>();
PlexRequestMock = new Mock<ISettingsService<PlexRequestSettings>>();
PlexRequestMock.Setup(x => x.GetSettings()).Returns(new PlexRequestSettings());
PlexRequestMock.Setup(x => x.GetSettingsAsync()).Returns(Task.FromResult(new PlexRequestSettings()));
Bootstrapper = new ConfigurableBootstrapper(with =>
{
with.Module<UserLoginModule>();
with.Dependency(PlexRequestMock.Object);
with.Dependency(AuthMock.Object);
with.Dependency(PlexMock.Object);
with.Dependency(LandingPageMock.Object);
with.RootPathProvider<TestRootPathProvider>();
});
}

Loading…
Cancel
Save