From fe7234f57152c3329218faa63cb2849df963ac3a Mon Sep 17 00:00:00 2001 From: Biarity Date: Wed, 7 Feb 2018 14:43:09 +1000 Subject: [PATCH] Made test stuff not generic --- SieveTests/Controllers/PostsController.cs | 4 ++-- ...lterMethodsOfPosts.cs => SieveCustomFilterMethods.cs} | 2 +- ...ethodsOfPosts - Copy.cs => SieveCustomSortMethods.cs} | 2 +- SieveTests/Startup.cs | 9 +++------ 4 files changed, 7 insertions(+), 10 deletions(-) rename SieveTests/Services/{SieveCustomFilterMethodsOfPosts.cs => SieveCustomFilterMethods.cs} (84%) rename SieveTests/Services/{SieveCustomSortMethodsOfPosts - Copy.cs => SieveCustomSortMethods.cs} (88%) diff --git a/SieveTests/Controllers/PostsController.cs b/SieveTests/Controllers/PostsController.cs index 9a2806a..92cf8fb 100644 --- a/SieveTests/Controllers/PostsController.cs +++ b/SieveTests/Controllers/PostsController.cs @@ -13,10 +13,10 @@ namespace SieveTests.Controllers [Route("api/[controller]/[action]")] public class PostsController : Controller { - private ISieveProcessor _sieveProcessor; + private ISieveProcessor _sieveProcessor; private ApplicationDbContext _dbContext; - public PostsController(ISieveProcessor sieveProcessor, + public PostsController(ISieveProcessor sieveProcessor, ApplicationDbContext dbContext) { _sieveProcessor = sieveProcessor; diff --git a/SieveTests/Services/SieveCustomFilterMethodsOfPosts.cs b/SieveTests/Services/SieveCustomFilterMethods.cs similarity index 84% rename from SieveTests/Services/SieveCustomFilterMethodsOfPosts.cs rename to SieveTests/Services/SieveCustomFilterMethods.cs index 6915ed0..f61d2af 100644 --- a/SieveTests/Services/SieveCustomFilterMethodsOfPosts.cs +++ b/SieveTests/Services/SieveCustomFilterMethods.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; namespace SieveTests.Services { - public class SieveCustomFilterMethodsOfPosts : ISieveCustomFilterMethods + public class SieveCustomFilterMethods : ISieveCustomFilterMethods { public IQueryable IsNew(IQueryable source, string op, string value) { diff --git a/SieveTests/Services/SieveCustomSortMethodsOfPosts - Copy.cs b/SieveTests/Services/SieveCustomSortMethods.cs similarity index 88% rename from SieveTests/Services/SieveCustomSortMethodsOfPosts - Copy.cs rename to SieveTests/Services/SieveCustomSortMethods.cs index 09c0ffb..3f4b811 100644 --- a/SieveTests/Services/SieveCustomSortMethodsOfPosts - Copy.cs +++ b/SieveTests/Services/SieveCustomSortMethods.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; namespace SieveTests.Services { - public class SieveCustomSortMethodsOfPosts : ISieveCustomSortMethods + public class SieveCustomSortMethods : ISieveCustomSortMethods { public IQueryable Popularity(IQueryable source, bool useThenBy, bool desc) { diff --git a/SieveTests/Startup.cs b/SieveTests/Startup.cs index c770cac..3856fac 100644 --- a/SieveTests/Startup.cs +++ b/SieveTests/Startup.cs @@ -35,12 +35,9 @@ namespace SieveTests services.Configure(Configuration.GetSection("Sieve")); - - //services.AddScoped(); - services.AddScoped, SieveCustomSortMethodsOfPosts>(); - services.AddScoped, SieveCustomFilterMethodsOfPosts>(); - services.AddScoped, SieveProcessor>(); - + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.