Example #1
0
        private void SetupAuctionRepository()
        {
            var mssqlConnectionString = TestContextUtils.GetParameterOrDefault("sqlserver", "Data Source=127.0.0.1;Initial Catalog=AuctionhouseDatabase;Integrated Security=False;User ID=sa;PWD=Qwerty1234;");

            AuctionRepository = new MsSqlAuctionRepository(new MsSqlConnectionSettings()
            {
                ConnectionString = mssqlConnectionString
            });
        }
Example #2
0
        private void SetupReadModelDbContext()
        {
            var mongoDbConnectionString =
                TestContextUtils.GetParameterOrDefault("mongodb-connection-string", "mongodb://localhost:27017");
            var dbContext = new ReadModelDbContext(new MongoDbSettings()
            {
                ConnectionString = mongoDbConnectionString,
                DatabaseName     = "appDb"
            }, new CategoryBuilder(CategoryTreeService));

            DbContext = dbContext;
        }
Example #3
0
        private void SetupAuctionImageRepository()
        {
            var mongoDbConnectionString =
                TestContextUtils.GetParameterOrDefault("mongodb-connection-string", "mongodb://localhost:27017");
            var dbContext = new ImageDbContext(new ImageDbSettings()
            {
                ConnectionString = mongoDbConnectionString,
                DatabaseName     = "appDb"
            });

            AuctionImageRepository = new AuctionImageRepository(dbContext, Mock.Of <ILogger <AuctionImageRepository> >());
        }
Example #4
0
        public void SetupEventBus(
            params IEventConsumer[] eventHandlers)
        {
            var rabbitMqConnectionString =
                TestContextUtils.GetParameterOrDefault("rabbitmq-connection-string", "host=localhost");

            _rabbitMqEventBus = new RabbitMqEventBus(new RabbitMqSettings()
            {
                ConnectionString = rabbitMqConnectionString
            }, Mock.Of <ILogger <RabbitMqEventBus> >());
            _rabbitMqEventBus.InitSubscribers(eventHandlers.Select(h => new RabbitMqEventConsumerFactory(() => h, h.MessageType.Name)).ToArray());
            EventBus = new EventBusService(_rabbitMqEventBus, AppEventBuilder);
        }
Example #5
0
        private void SetupTimeTaskClient()
        {
            var timeTaskConnectionString = TestContextUtils.GetParameterOrDefault("quartz-web-task-service", "http://localhost:5001");
            var auctionEchoTaskEndpoint  = TestContextUtils.GetParameterOrDefault("quartz-web-task-target-endpoint", "http://host.docker.internal:9998/test");

            TimetaskServiceSettings = new TimeTaskServiceSettings()
            {
                ConnectionString           = timeTaskConnectionString,
                AuctionEndEchoTaskEndpoint = auctionEchoTaskEndpoint,
                ApiKey = "testk"
            };
            TimeTaskClient   = RestClient.For <ITimeTaskClient>(TimetaskServiceSettings.ConnectionString);
            SchedulerService = new AuctionSchedulerService(TimeTaskClient, TimetaskServiceSettings);
        }