예제 #1
0
        public FindSeatsController(IEventSectionRepository eventSectionRepository, ISectionRepository sectionRepository, IEventsRepository eventsRepository, ITicketRepository ticketRepository, ITicketPurchaseRepository ticketPurchaseRepository, IHelper helper, IStringLocalizer <FindSeatsController> localizer, IStringLocalizer <BaseController> baseLocalizer) : base(baseLocalizer, helper)
        {
            _eventSectionRepository    = eventSectionRepository;
            _sectionRepository         = sectionRepository;
            _eventsRepository          = eventsRepository;
            _ticketRepository          = ticketRepository;
            _iTicketPurchaseRepository = ticketPurchaseRepository;
            _localizer = localizer;

            Thread.CurrentThread.CurrentCulture   = CultureInfo.CreateSpecificCulture(Startup.TenantConfig.TenantCulture);
            Thread.CurrentThread.CurrentUICulture = new CultureInfo(Startup.TenantConfig.TenantCulture);
            _connectionString = helper.GetBasicSqlConnectionString(Startup.DatabaseConfig);
        }
예제 #2
0
        public void GetEventSectionsTest()
        {
            _eventSectionRepository = new MockEventSectionRepository();
            _connectionString       = "User ID=developer;Password=password;Connect Timeout=0;Application Name=EntityFramework";
            _tenantId = 1368421345;

            var result = _eventSectionRepository.GetEventSections(1, _connectionString, _tenantId);

            Assert.IsNotNull(result);
            Assert.AreEqual(3, result.Count);
            Assert.AreEqual(1, result[0].SectionId);
            Assert.AreEqual(1, result[0].EventId);
            Assert.AreEqual(100, result[0].Price);
            Assert.AreEqual(2, result[1].SectionId);
            Assert.AreEqual(1, result[1].EventId);
            Assert.AreEqual(80, result[1].Price);
            Assert.AreEqual(3, result[2].SectionId);
            Assert.AreEqual(1, result[2].EventId);
            Assert.AreEqual(60, result[2].Price);
        }