public void ClasslevelSetUp()
 {
     AutomapperConfiguration.Initialize();
     _factory = new MockRepository(MockBehavior.Loose);
     _classicRmsMasterIndicesRepository = _factory.Create <IClassicRMSMasterIndicesRepository>();
     _summariesUnitOfWork = _factory.Create <ISummariesUnitOfWork>();
     _reportsUnitOfWork   = _factory.Create <IReportsUnitOfWork>();
     _classicRmsMasterIndicesRepository.Setup(mock => mock.FindMasterProperty(It.IsAny <int>())).Returns(new ClassicMasterProperty());
     _masterIndexSearchService = new MasterIndexSearchService(_classicRmsMasterIndicesRepository.Object, _summariesUnitOfWork.Object, _reportsUnitOfWork.Object, Mock.Of <ILog>(), Mock.Of <IServiceAuthorizationPolicy>(), Mock.Of <IServiceIdentityProvider>());
 }
Exemplo n.º 2
0
        public virtual void SetUp()
        {
            AutomapperConfiguration.Configure();
            _autoMocker = new RhinoAutoMocker <HomeController>();

            _autoMocker.Inject <IMapperFactory>(new MapperFactory(new Container(c =>
            {
                c.AddRegistry <TestRegistry>();
            })));
        }
Exemplo n.º 3
0
 protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     Bootstrapper.Run();
     AutomapperConfiguration.Configure();
     GlobalConfiguration.Configure(WebApiConfig.Register);
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
 }
Exemplo n.º 4
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            var mapper = AutomapperConfiguration.Init();

            IoCBuilder.InitWeb(Assembly.GetExecutingAssembly(), mapper);
        }
Exemplo n.º 5
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            _applicationWideWindsorContainer.Install(new WindsorInstaller());
            ControllerBuilder.Current.SetControllerFactory(new WindsorControllerFactory(_applicationWideWindsorContainer));

            AutomapperConfiguration.Configure();
            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);
        }
Exemplo n.º 6
0
 public Startup(IConfiguration configuration,
                IHostingEnvironment hostingEnvironment)
 {
     Configuration                  = configuration;
     HostingEnvironment             = hostingEnvironment;
     MvcConfiguration               = new MvcConfiguration();
     MediatRConfiguration           = new MediatRConfiguration();
     JwtAuthenticationConfiguration = new JwtAuthenticationConfiguration(configuration);
     AutomapperConfiguration        = new AutomapperConfiguration();
     WebApiDIConfiguration          = new WebApiDIConfiguration(configuration);
 }
        public void InvokeCategoryServiceCreate_WhenCategoryNotAvailable()
        {
            //Arrange
            Mapper.Reset();
            AutomapperConfiguration.Initialize();
            var productToImport = new ProductImportModel
            {
                Category      = "Patkiii",
                Name          = "TestProduct",
                PurchasePrice = 50m,
                Quantity      = 5,
                Supplier      = "TestSupplier"
            };
            var productsToImport = new List <ProductImportModel> {
                productToImport
            };

            var mockContext    = new Mock <IOnlineStoreContext>();
            var productsMock   = new List <Product>().GetQueryableMockDbSet();
            var categoriesMock = new List <Category> {
                new Category {
                    Name = "TestCategory"
                }
            }.GetQueryableMockDbSet();
            var categoriesAddedMock = new List <Category> {
                new Category {
                    Name = "Patkiii"
                }
            }.GetQueryableMockDbSet();
            var suppliersMock = new List <Supplier> {
                new Supplier {
                    Name = "TestSupplier"
                }
            }.GetQueryableMockDbSet();
            var fakemapper = new Mock <IMapper>();

            fakemapper.Setup(x => x.Map <IProductImportModel, Product>(It.IsAny <IProductImportModel>())).Returns(new Product {
                Name = productToImport.Name, PurchasePrice = productToImport.PurchasePrice, SellingPrice = productToImport.PurchasePrice * 1.5m, Quantity = productToImport.Quantity
            });

            var fakeCategoryService = new Mock <ICategoryService>();

            mockContext.SetupSequence(s => s.Categories).Returns(categoriesMock.Object).Returns(categoriesAddedMock.Object);
            mockContext.Setup(s => s.Suppliers).Returns(suppliersMock.Object);
            mockContext.Setup(s => s.Products).Returns(productsMock.Object);
            var service = new Logic.Services.ProductService(mockContext.Object, fakemapper.Object, fakeCategoryService.Object);

            //Act
            service.AddProductRange(productsToImport);

            //Assert
            fakeCategoryService.Verify(v => v.Create(It.IsAny <string>()), Times.Once);
        }
Exemplo n.º 8
0
        public void Before()
        {
            var builder = new TestControllerBuilder();

            _postRepository = MockRepository.GenerateStub <IPostRepository>();
            _postRepository.Stub(x => x.GetAllPost()).Return(new List <Post>());
            // using real automapper
            AutomapperConfiguration.Configure();

            _sut = new HomeController(_postRepository, new AutomapperWrapper());
            builder.InitializeController(_sut);
        }
Exemplo n.º 9
0
        static void Main()
        {
            AutomapperConfiguration.Initialize();
            var builder = new ContainerBuilder();

            builder.RegisterModule(new AutofacConfiguration());
            var container = builder.Build();

            var engine = container.Resolve <IEngine>();

            engine.Run();
        }
Exemplo n.º 10
0
        public void LoadAssemblyBindings(IKernel kernel)
        {
            var modules = new INinjectModule[] { new ServiceModule("UserDB") };

            kernel.Load(modules);

            kernel.Bind <IUserService>().To <BLL.Services.UserService>();

            var config = new AutomapperConfiguration();
            var mapper = config.Configure().CreateMapper();

            kernel.Bind <IMapper>().ToConstant(mapper).InSingletonScope();
        }
Exemplo n.º 11
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            //  don't want to set an initializer since we are doing code first with migrations
            //  and the Configuration will call the DataSeeder.
            Database.SetInitializer <NemeStatsDbContext>(null);
            AutomapperConfiguration.Configure();
        }
Exemplo n.º 12
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            //Load map entity -> viewmodels
            AutomapperConfiguration.Configure();

            //--> Autofac
            AutofacConfiguration.Register();
        }
Exemplo n.º 13
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            ControllerBuilder.Current.SetControllerFactory(new NinjectControllerFactory());
            AutomapperConfiguration.IntializeAutomapper();

            var kernel = WebApiConfig.Register(GlobalConfiguration.Configuration);

            GlobalConfiguration.Configuration.EnsureInitialized();
        }
        public void InvokeRemoveMethod_WhenProductIsFound()
        {
            //Arrange
            Mapper.Reset();
            AutomapperConfiguration.Initialize();
            var productToAdd = new ProductImportModel
            {
                Name          = "Testproduct2",
                Supplier      = "TestSupplier",
                Category      = "TestCategory",
                PurchasePrice = 5.50m,
                Quantity      = 5
            };
            var mockContext  = new Mock <IOnlineStoreContext>();
            var productsMock = new List <Product> {
                new Product {
                    Name = "Testproduct", Quantity = 5, Category = new Category {
                        Name = "Patki"
                    }
                }
            }.GetQueryableMockDbSet();
            var categoriesMock = new List <Category> {
                new Category {
                    Name = "TestCategory"
                }
            }.GetQueryableMockDbSet();
            var suppliersMock = new List <Supplier> {
                new Supplier {
                    Name = "TestSupplier"
                }
            }.GetQueryableMockDbSet();
            var fakemapper = new Mock <IMapper>();

            fakemapper.Setup(x => x.Map <Product>(It.IsAny <IProductImportModel>())).Returns(new Product {
                Name = productToAdd.Name, PurchasePrice = productToAdd.PurchasePrice, SellingPrice = productToAdd.PurchasePrice * 1.5m
            });

            var fakeCategoryService = new Mock <ICategoryService>();

            mockContext.Setup(s => s.Categories).Returns(categoriesMock.Object);
            mockContext.Setup(s => s.Suppliers).Returns(suppliersMock.Object);
            mockContext.Setup(s => s.Products).Returns(productsMock.Object);
            var service = new Logic.Services.ProductService(mockContext.Object, fakemapper.Object, fakeCategoryService.Object);

            //Act
            service.RemoveProductByName("Testproduct");

            //Assert
            productsMock.Verify(v => v.Remove(It.IsNotNull <Product>()), Times.Once);
        }
Exemplo n.º 15
0
 public void ClassLevelSetup()
 {
     AutomapperConfiguration.Initialize();
     _administrationUnitOfWork = new Mock <IAdministrationUnitOfWork>();
     Assert.IsInstanceOf(typeof(IAdministrationUnitOfWork), _administrationUnitOfWork.Object);
     _identityProvider    = new Mock <IServiceIdentityProvider>();
     _authorizationPolicy = new Mock <IServiceAuthorizationPolicy>();
     _dependencyContainer = new Mock <IDependencyContainer>();
     Assert.IsInstanceOf(typeof(IDependencyContainer), _dependencyContainer.Object);
     _userQueryService = new UserQueryService(_administrationUnitOfWork.Object, Mock.Of <ILog>(), _authorizationPolicy.Object, _identityProvider.Object);
     Assert.IsInstanceOf(typeof(UserQueryService), _userQueryService);
     SetUpUser();
     SetAgencyPermissions();
 }
Exemplo n.º 16
0
        protected void Application_Start()
        {
            _container = Bootstrapper.InitializeContainer();

            AutomapperConfiguration.Configure();
            AreaRegistration.RegisterAllAreas();

            HiperionConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            Database.SetInitializer(new DropCreateDatabaseIfModelChanges <UserContext>());
        }
        public void Setup()
        {
            // Setup unit of work with fake data to all including repos that using in unit of work
            Mock <ICargoTypeCategoryRepository> cargoTypeCategoryRepo = new Mock <ICargoTypeCategoryRepository>();
            Mock <ICargoTypeRepository>         cargoTypeRepo         = new Mock <ICargoTypeRepository>();

            cargoTypeCategoryRepo.Setup(repo => repo.GetAll()).Returns(CargoTypeCategoryFakeItems);
            cargoTypeRepo.Setup(rep => rep.GetAll()).Returns(CargoTypesFakeItems);
            _mockUnitOfWork = new Mock <IUnitOfWork>();
            _mockUnitOfWork.Setup(r => r.CargoTypeCategories).Returns(cargoTypeCategoryRepo.Object);
            _mockUnitOfWork.Setup(r => r.CargoTypes).Returns(cargoTypeRepo.Object);
            _cargoService = new CargoService(_mockUnitOfWork.Object);
            // Load mapping
            AutomapperConfiguration.Load();
        }
        private void RegisterContainer()
        {
            if (!AutomapperConfiguration.ShouldInitialize)
            {
                AutomapperConfiguration.Initialize();
            }

            var builder = new ContainerBuilder();

            builder.RegisterAssemblyModules(Assembly.GetExecutingAssembly());
            var container = builder.Build();

            this.MainController = container.Resolve <IMainController>();
            this.UserContext    = container.Resolve <UserContext>();
        }
Exemplo n.º 19
0
        public void Setup()
        {
            // Setup unit of work with fake data to all including repos that using in unit of work
            Mock <IOrganizationRepository>     organizationRepository     = new Mock <IOrganizationRepository>();
            Mock <IOrganizationTypeRepository> organizationTypeRepository = new Mock <IOrganizationTypeRepository>();

            organizationRepository.Setup(repo => repo.GetAll()).Returns(OrganizationsFakeItems);
            organizationTypeRepository.Setup(rep => rep.GetAll()).Returns(OrganizationTypeFakeItems);
            _mockUnitOfWork = new Mock <IUnitOfWork>();
            _mockUnitOfWork.Setup(r => r.OrganizationRepository).Returns(organizationRepository.Object);
            _mockUnitOfWork.Setup(r => r.OrganizationTypeRepository).Returns(organizationTypeRepository.Object);
            _organizationService = new OrganizationService(_mockUnitOfWork.Object);
            // Load mapping
            AutomapperConfiguration.Load();
        }
Exemplo n.º 20
0
        /// <summary>
        /// Registers the type mappings with the Unity container.
        /// </summary>
        /// <param name="container">The unity container to configure.</param>
        /// <remarks>
        /// There is no need to register concrete types such as controllers or
        /// API controllers (unless you want to change the defaults), as Unity
        /// allows resolving a concrete type even if it was not previously
        /// registered.
        /// </remarks>
        public static void RegisterTypes(IUnityContainer container)
        {
            // NOTE: To load from web.config uncomment the line below.
            // Make sure to add a Unity.Configuration to the using statements.
            // container.LoadConfiguration();

            // TODO: Register your type's mappings here.
            // container.RegisterType<IProductRepository, ProductRepository>();
            var serviceUrl = WebConfigurationManager.AppSettings["serviceUrl"].ToString();
            var getUrl     = WebConfigurationManager.AppSettings["getUrl"].ToString();

            container.RegisterInstance <IFloodMonitoringService>(new FloodMonitoringService(serviceUrl, getUrl));
            var mapper = new Mapper(AutomapperConfiguration.GetConfig());

            container.RegisterInstance(mapper);
        }
        public async Task LoadTimeByOptionsTest()
        {
            var productDataService = AppObjectFactory.GetContainer().GetInstance <IProductDataService>();

            AutomapperConfiguration.Cofigure(AppObjectFactory.GetContainer());

            var stopWatch = new Stopwatch();

            stopWatch.Start();
            var product = productDataService.Query.IncludeNecessaryData()
                          .FirstOrDefault();
            await product.LoadDataByOptionsAsync(AppObjectFactory.GetContainer().GetInstance <IUnitOfWork>());

            stopWatch.Stop();
            Console.Write(stopWatch.Elapsed + " elapsed");
        }
Exemplo n.º 22
0
 public virtual void SetUp()
 {
     AutomapperConfiguration.Configure();
     playerSummaryBuilderMock          = MockRepository.GenerateMock <IPlayerSummaryBuilder>();
     topPlayerViewModelBuilderMock     = MockRepository.GenerateMock <ITopPlayerViewModelBuilder>();
     playedGameRetrieverMock           = MockRepository.GenerateMock <IPlayedGameRetriever>();
     nemesisHistoryRetrieverMock       = MockRepository.GenerateMock <INemesisHistoryRetriever>();
     nemesisChangeViewModelBuilderMock = MockRepository.GenerateMock <INemesisChangeViewModelBuilder>();
     gamingGroupRetrieverMock          = MockRepository.GenerateMock <IGamingGroupRetriever>();
     homeControllerPartialMock         = MockRepository.GeneratePartialMock <HomeController>(
         playerSummaryBuilderMock,
         topPlayerViewModelBuilderMock,
         playedGameRetrieverMock,
         nemesisHistoryRetrieverMock,
         nemesisChangeViewModelBuilderMock,
         gamingGroupRetrieverMock);
 }
Exemplo n.º 23
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            ControllerBuilder.Current.SetControllerFactory(new NinjectControllerFactory());
            AutomapperConfiguration.IntializeAutomapper();

            var kernel = WebApiConfig.Register(GlobalConfiguration.Configuration);

            GlobalConfiguration.Configuration.EnsureInitialized();

            AntiForgeryConfig.UniqueClaimTypeIdentifier = ClaimTypes.NameIdentifier;

            GlobalTrackingConfig.DisconnectedContext = true;
        }
        public void ThrowArgumentException_WhenSupplierNotFound()
        {
            //Arrange
            Mapper.Reset();
            AutomapperConfiguration.Initialize();
            var productToImport = new ProductImportModel
            {
                Category      = "TestCategory",
                Name          = "TestProduct",
                PurchasePrice = 50m,
                Quantity      = 5,
                Supplier      = "Pesho"
            };
            var productsToImport = new List <ProductImportModel> {
                productToImport
            };

            var mockContext    = new Mock <IOnlineStoreContext>();
            var productsMock   = new List <Product>().GetQueryableMockDbSet();
            var categoriesMock = new List <Category> {
                new Category {
                    Name = "TestCategory"
                }
            }.GetQueryableMockDbSet();
            var suppliersMock = new List <Supplier> {
                new Supplier {
                    Name = "TestSupplier"
                }
            }.GetQueryableMockDbSet();
            var fakemapper = new Mock <IMapper>();

            fakemapper.Setup(x => x.Map <IProductImportModel, Product>(It.IsAny <IProductImportModel>())).Returns(new Product {
                Name = productToImport.Name, PurchasePrice = productToImport.PurchasePrice, SellingPrice = productToImport.PurchasePrice * 1.5m, Quantity = productToImport.Quantity
            });

            var fakeCategoryService = new Mock <ICategoryService>();

            mockContext.Setup(s => s.Categories).Returns(categoriesMock.Object);
            mockContext.Setup(s => s.Suppliers).Returns(suppliersMock.Object);
            mockContext.Setup(s => s.Products).Returns(productsMock.Object);
            var service = new Logic.Services.ProductService(mockContext.Object, fakemapper.Object, fakeCategoryService.Object);

            //Act && Assert
            Assert.ThrowsException <ArgumentException>(() => service.AddProductRange(productsToImport));
        }
        public void ReturnInstanceOfTypeIEnumerableIOrderProduct_WhenInvoked()
        {
            // Arrange
            Mapper.Reset();
            AutomapperConfiguration.Initialize();
            var mockContext = new Mock <IOnlineStoreContext>();
            var usersMock   = new List <User> {
                new User {
                    Username = "******"
                }
            }.GetQueryableMockDbSet();
            var couriersMock = new List <Courier> {
                new Courier {
                    FirstName = "Peshko", LastName = "Peshkov"
                }
            }.GetQueryableMockDbSet();
            var ordersMock = new List <Order> {
                new Order()
            }.GetQueryableMockDbSet();
            var productsMock = new List <Product> {
                new Product {
                    Name = "Testproduct", Quantity = 5
                }
            }.GetQueryableMockDbSet();
            var orderProductsMock = new List <OrderProduct> {
                new OrderProduct()
            }.GetQueryableMockDbSet();

            IDictionary <string, int> productsCounts = new Dictionary <string, int>();

            productsCounts.Add("Testproduct", 2);
            mockContext.Setup(x => x.Users).Returns(usersMock.Object);
            mockContext.Setup(x => x.Couriers).Returns(couriersMock.Object);
            mockContext.Setup(s => s.Orders).Returns(ordersMock.Object);
            mockContext.Setup(s => s.Products).Returns(productsMock.Object);
            mockContext.Setup(s => s.OrderProducts).Returns(orderProductsMock.Object);

            var service = new Logic.Services.OrderService(mockContext.Object);

            // Act
            var orders = service.GetAllOrders();

            //Assert
            Assert.IsInstanceOfType(orders, typeof(IEnumerable <IOrderModel>));
        }
Exemplo n.º 26
0
        protected void Application_Start()
        {
            MiniProfilerEF6.Initialize();

            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            var container = AutofacConfig.Register();

            AutomapperConfiguration.Configure(container);
            QuartzStart.Run();

            ViewEngines.Engines.Clear();
            ViewEngines.Engines.Add(new RazorThemeViewEngine());
        }
Exemplo n.º 27
0
        public static void RegisterServices(IServiceCollection services, string connectionString)
        {
            services.AddDbContext <ShoppingCartDbContext>(options =>
                                                          options.UseSqlServer(connectionString));

            services.AddScoped <IProductsRepository, ProductsRepositorycs>();
            services.AddScoped <IProductService, ProductsService>();

            services.AddScoped <ICategoryRepository, CategoriesRepository>();
            services.AddScoped <ICategoryService, CategoriesService>();


            services.AddScoped <IMembersRepository, MembersRepostory>();
            services.AddScoped <IMembersService, MembersSerivce>();

            services.AddAutoMapper(typeof(AutomapperConfiguration));
            AutomapperConfiguration.RegisterMappings();
        }
Exemplo n.º 28
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);

            RouteConfig.RegisterRoutes(RouteTable.Routes);

            BundleConfig.RegisterBundles(BundleTable.Bundles);

            ConfigureDependencyInjection();

            AutomapperConfiguration.Configure <WebLayerMapperProfile>(cfg =>
            {
                cfg.AddProfile(new ServiceLayerMapperProfile());
                cfg.IgnoreUnmapped();
            });
        }
Exemplo n.º 29
0
        public void BaseSetUp()
        {
            AutomapperConfiguration.Configure();
            this.autoMocker = new RhinoAutoMocker <T>();
            var controllerContextMock = MockRepository.GeneratePartialMock <HttpControllerContext>();
            var actionDescriptorMock  = MockRepository.GenerateMock <HttpActionDescriptor>();

            this.autoMocker.ClassUnderTest.ActionContext = new HttpActionContext(controllerContextMock, actionDescriptorMock);

            this.applicationUser = new ApplicationUser
            {
                Id = "application user id",
                CurrentGamingGroupId = EXPECTED_GAMING_GROUP_ID
            };
            autoMocker.ClassUnderTest.CurrentUser = this.applicationUser;

            this.autoMocker.ClassUnderTest.Request = new HttpRequestMessage();
            this.autoMocker.ClassUnderTest.Request.SetConfiguration(new HttpConfiguration());
        }
        public void Configure(IApplicationBuilder app,
                              IHostingEnvironment env,
                              IServiceProvider serviceProvider)
        {
            app.UseQuartz();
            app.UseCors("CorsPolicy");
            app.UseExceptionHandler(eApp =>
            {
                eApp.Run(async context =>
                {
                    context.Response.StatusCode  = StatusCodes.Status500InternalServerError;
                    context.Response.ContentType = "application/json";

                    var errorCtx = context.Features.Get <IExceptionHandlerFeature>();
                    if (errorCtx != null)
                    {
                        var ex = errorCtx.Error;
                        WebHelper.LogWebError("Exception", Constants.General.ApiName, ex, context);

                        var errorId      = Activity.Current?.Id ?? context.TraceIdentifier;
                        var jsonResponse = JsonConvert.SerializeObject(new CustomErrorResponse
                        {
                            ErrorId = errorId,
                            Message = "An error occurred in the api. If you need assistance please contact our support with the given errorId."
                        });
                        await context.Response.WriteAsync(jsonResponse, Encoding.UTF8);
                    }
                });
            });

            app.UseSignalR(routes =>
            {
                routes.MapHub <StockHub>("/coolmessages");
            });

            AutomapperConfiguration.ConfigureProfiles();

            app.UseSwaggerDocumentation()
            .UseStatusCodePages()
            .UseAuthentication()
            .UseMvc();
        }