Removed the service locator from the base classes and added in some Api tests

added all the tests back in!
This commit is contained in:
tidusjar 2016-05-19 17:02:46 +01:00
parent 187a59261a
commit 84dc4515fd
21 changed files with 251 additions and 176 deletions

View file

@ -30,6 +30,7 @@ using System.Linq;
using Nancy;
using Nancy.Validation;
using PlexRequests.Core;
using PlexRequests.Core.SettingModels;
using PlexRequests.Store;
@ -37,16 +38,20 @@ namespace PlexRequests.UI.Modules
{
public abstract class BaseApiModule : BaseModule
{
protected BaseApiModule()
protected BaseApiModule(ISettingsService<PlexRequestSettings> s) : base(s)
{
Settings = s;
Before += (ctx) => CheckAuth();
}
protected BaseApiModule(string modulePath) : base(modulePath)
protected BaseApiModule(string modulePath, ISettingsService<PlexRequestSettings> s) : base(modulePath, s)
{
Settings = s;
Before += (ctx) => CheckAuth();
}
private ISettingsService<PlexRequestSettings> Settings { get; }
protected Response ReturnReponse(object result)
{
var queryString = (DynamicDictionary)Context.Request.Query;