mirror of
https://github.com/Biarity/Sieve.git
synced 2024-11-24 22:42:30 +01:00
Made test stuff not generic
This commit is contained in:
parent
135e7255a8
commit
fe7234f571
@ -13,10 +13,10 @@ namespace SieveTests.Controllers
|
||||
[Route("api/[controller]/[action]")]
|
||||
public class PostsController : Controller
|
||||
{
|
||||
private ISieveProcessor<Post> _sieveProcessor;
|
||||
private ISieveProcessor _sieveProcessor;
|
||||
private ApplicationDbContext _dbContext;
|
||||
|
||||
public PostsController(ISieveProcessor<Post> sieveProcessor,
|
||||
public PostsController(ISieveProcessor sieveProcessor,
|
||||
ApplicationDbContext dbContext)
|
||||
{
|
||||
_sieveProcessor = sieveProcessor;
|
||||
|
@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace SieveTests.Services
|
||||
{
|
||||
public class SieveCustomFilterMethodsOfPosts : ISieveCustomFilterMethods<Post>
|
||||
public class SieveCustomFilterMethods : ISieveCustomFilterMethods
|
||||
{
|
||||
public IQueryable<Post> IsNew(IQueryable<Post> source, string op, string value)
|
||||
{
|
@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace SieveTests.Services
|
||||
{
|
||||
public class SieveCustomSortMethodsOfPosts : ISieveCustomSortMethods<Post>
|
||||
public class SieveCustomSortMethods : ISieveCustomSortMethods
|
||||
{
|
||||
public IQueryable<Post> Popularity(IQueryable<Post> source, bool useThenBy, bool desc)
|
||||
{
|
@ -35,12 +35,9 @@ namespace SieveTests
|
||||
|
||||
services.Configure<SieveOptions>(Configuration.GetSection("Sieve"));
|
||||
|
||||
|
||||
//services.AddScoped<ISieveProcessor, SieveProcessor>();
|
||||
services.AddScoped<ISieveCustomSortMethods<Post>, SieveCustomSortMethodsOfPosts>();
|
||||
services.AddScoped<ISieveCustomFilterMethods<Post>, SieveCustomFilterMethodsOfPosts>();
|
||||
services.AddScoped<ISieveProcessor<Post>, SieveProcessor<Post>>();
|
||||
|
||||
services.AddScoped<ISieveCustomSortMethods, SieveCustomSortMethods>();
|
||||
services.AddScoped<ISieveCustomFilterMethods, SieveCustomFilterMethods>();
|
||||
services.AddScoped<ISieveProcessor, SieveProcessor>();
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
|
Loading…
Reference in New Issue
Block a user