Made test stuff not generic

This commit is contained in:
Biarity 2018-02-07 14:43:09 +10:00
parent 135e7255a8
commit fe7234f571
4 changed files with 7 additions and 10 deletions

View File

@ -13,10 +13,10 @@ namespace SieveTests.Controllers
[Route("api/[controller]/[action]")] [Route("api/[controller]/[action]")]
public class PostsController : Controller public class PostsController : Controller
{ {
private ISieveProcessor<Post> _sieveProcessor; private ISieveProcessor _sieveProcessor;
private ApplicationDbContext _dbContext; private ApplicationDbContext _dbContext;
public PostsController(ISieveProcessor<Post> sieveProcessor, public PostsController(ISieveProcessor sieveProcessor,
ApplicationDbContext dbContext) ApplicationDbContext dbContext)
{ {
_sieveProcessor = sieveProcessor; _sieveProcessor = sieveProcessor;

View File

@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace SieveTests.Services namespace SieveTests.Services
{ {
public class SieveCustomFilterMethodsOfPosts : ISieveCustomFilterMethods<Post> public class SieveCustomFilterMethods : ISieveCustomFilterMethods
{ {
public IQueryable<Post> IsNew(IQueryable<Post> source, string op, string value) public IQueryable<Post> IsNew(IQueryable<Post> source, string op, string value)
{ {

View File

@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace SieveTests.Services namespace SieveTests.Services
{ {
public class SieveCustomSortMethodsOfPosts : ISieveCustomSortMethods<Post> public class SieveCustomSortMethods : ISieveCustomSortMethods
{ {
public IQueryable<Post> Popularity(IQueryable<Post> source, bool useThenBy, bool desc) public IQueryable<Post> Popularity(IQueryable<Post> source, bool useThenBy, bool desc)
{ {

View File

@ -35,12 +35,9 @@ namespace SieveTests
services.Configure<SieveOptions>(Configuration.GetSection("Sieve")); services.Configure<SieveOptions>(Configuration.GetSection("Sieve"));
services.AddScoped<ISieveCustomSortMethods, SieveCustomSortMethods>();
//services.AddScoped<ISieveProcessor, SieveProcessor>(); services.AddScoped<ISieveCustomFilterMethods, SieveCustomFilterMethods>();
services.AddScoped<ISieveCustomSortMethods<Post>, SieveCustomSortMethodsOfPosts>(); services.AddScoped<ISieveProcessor, SieveProcessor>();
services.AddScoped<ISieveCustomFilterMethods<Post>, SieveCustomFilterMethodsOfPosts>();
services.AddScoped<ISieveProcessor<Post>, SieveProcessor<Post>>();
} }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.