// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddMvc(); //AppSettings services.Configure <Settings>(options => Configuration.GetSection("Settings").Bind(options)); //Adding Swagger Documentation services.AddSwaggerGen(c => c.SwaggerDoc("v1", new Info { Title = "Shopping API", Version = "v1" })); //Other registrations services.AddSingleton <IUserRepository, UserRepository>(); services.AddSingleton <IProductsClient, ProductsClient>(); services.AddSingleton <IShopperHistoryClient, ShopperHistoryClient>(); services.AddSingleton <IProductService, ProductService>(); services.AddSingleton <ITrolleyCalculatorClient, TrolleyCalculatorClient>(); services.AddSingleton <IProductSorter, LowPriceProductSorter>(); services.AddSingleton <IProductSorter, HighPriceProductSorter>(); services.AddSingleton <IProductSorter, NameAscendingProductSorter>(); services.AddSingleton <IProductSorter, NameDescendingProductSorter>(); services.AddSingleton <IProductSorter, RecommendedProductSorter>(); //Automapper AutomapperMappings.Initialize(); }
public UserControllerTests() { AutomapperMappings.Initialize(); _fixure = new Fixture(); _userRepository = new Mock <IUserRepository>(); }