Ejemplo n.º 1
0
        public void Initialize()
        {
            Db.ClearTables();
            Db.PopulateSignal();
            Db.PopulateSignalsWithApproaches();
            Db.PopulateApproachesWithDetectors();
            var signals = Db.Signals;

            foreach (var signal in signals)
            {
                Db.PopulatePreemptAggregations(Convert.ToDateTime("1/1/2016"), Convert.ToDateTime("1/1/2018"), signal.SignalID, signal.VersionID);
            }

            ApproachRepositoryFactory.SetApproachRepository(new InMemoryApproachRepository(Db));
            PreemptAggregationDatasRepositoryFactory.SetArchivedMetricsRepository(
                new InMemoryPreemptAggregationDatasRepository(Db));
            MOE.Common.Models.Repositories.SignalsRepositoryFactory.SetSignalsRepository(
                new InMemorySignalsRepository(Db));
            MetricTypeRepositoryFactory.SetMetricsRepository(new InMemoryMetricTypeRepository(Db));
            ApplicationEventRepositoryFactory.SetApplicationEventRepository(new InMemoryApplicationEventRepository(Db));
            DetectorAggregationsRepositoryFactory.SetDetectorAggregationRepository(new InMemoryDetectorAggregationsRepository(Db));

            Models.Repositories.DirectionTypeRepositoryFactory.SetDirectionsRepository(
                new InMemoryDirectionTypeRepository());

            SignalsRepository = SignalsRepositoryFactory.Create();

            PreemptAggregationDatasRepositoryFactory.SetArchivedMetricsRepository(new InMemoryPreemptAggregationDatasRepository(Db));
        }
        public void Initialize()
        {
            Db.ClearTables();
            Db.PopulateSignal();
            Db.PopulateSignalsWithApproaches();
            Db.PopulateApproachesWithDetectors();
            var signals = Db.Signals;

            foreach (var signal in signals)
            {
                foreach (var approach in signal.Approaches)
                {
                    Db.PopulateApproachSplitFailAggregationsWithRandomRecords(Convert.ToDateTime("1/1/2016"),
                                                                              Convert.ToDateTime("1/1/2018"), approach);
                }
            }
            ApproachSplitFailAggregationRepositoryFactory.SetApplicationEventRepository(
                new InMemoryApproachSplitFailAggregationRepository(Db));
            MOE.Common.Models.Repositories.SignalsRepositoryFactory.SetSignalsRepository(
                new InMemorySignalsRepository(Db));
            MetricTypeRepositoryFactory.SetMetricsRepository(new InMemoryMetricTypeRepository(Db));
            ApplicationEventRepositoryFactory.SetApplicationEventRepository(new InMemoryApplicationEventRepository(Db));
            Models.Repositories.DirectionTypeRepositoryFactory.SetDirectionsRepository(
                new InMemoryDirectionTypeRepository());
            SignalsRepository = SignalsRepositoryFactory.Create();
        }
Ejemplo n.º 3
0
        public void Initialize()
        {
            _db.ClearTables();
            _db.PopulateSignal();
            _db.PopulateRoutes();
            _db.PopulateRouteWithRouteSignals();
            _db.PopulateRouteSignalsWithPhaseDirection();

            InMemoryRouteRepository routeRepo = new InMemoryRouteRepository(_db);

            MOE.Common.Models.Repositories.RouteRepositoryFactory.SetApproachRouteRepository(routeRepo);
        }
        public SignalAggregationCreateMetricTestsBase()
        {
            Db.ClearTables();
            Db.PopulateSignal();
            Db.PopulateSignalsWithApproaches();
            Db.PopulateApproachesWithDetectors();
            MOE.Common.Models.Repositories.SignalsRepositoryFactory.SetSignalsRepository(new InMemorySignalsRepository(Db));
            MetricTypeRepositoryFactory.SetMetricsRepository(new InMemoryMetricTypeRepository(Db));
            ApplicationEventRepositoryFactory.SetApplicationEventRepository(new InMemoryApplicationEventRepository(Db));
            Common.Models.Repositories.DirectionTypeRepositoryFactory.SetDirectionsRepository(new InMemoryDirectionTypeRepository());
            ApproachRepositoryFactory.SetApproachRepository(new InMemoryApproachRepository(Db));
            MOE.Common.Models.Repositories.ApproachEventCountAggregationRepositoryFactory.SetRepository
                (new InMemoryApproachEventCountAggregationRepository(Db));

            MOE.Common.Models.Repositories.SignalEventCountAggregationRepositoryFactory.SetRepository
                (new InMemorySignalEventCountAggregationRepository(Db));
            SetSpecificAggregateRepositoriesForTest();
        }
Ejemplo n.º 5
0
 public void Initialize()
 {
     db.ClearTables();
     XmlToListImporter.LoadControllerEventLog("7185_10_17_2017.xml", db);
     XmlToListImporter.LoadSignals("signals.xml", db);
     XmlToListImporter.LoadApproaches("approachesfor7185.xml", db);
     XmlToListImporter.LoadDetectors("detectorsFor7185.xml", db);
     XmlToListImporter.AddDetectionTypesToDetectors
         ("DetectorTypesforDetectorsFor7185.xml", db);
     XmlToListImporter.AddDetectionTypesToMetricTypes("mtdt.xml", db);
     MOE.Common.Models.Repositories.SignalsRepositoryFactory.SetSignalsRepository(
         new InMemorySignalsRepository(db));
     MetricTypeRepositoryFactory.SetMetricsRepository(new InMemoryMetricTypeRepository(db));
     ApplicationEventRepositoryFactory.SetApplicationEventRepository(
         new InMemoryApplicationEventRepository(db));
     Models.Repositories.DirectionTypeRepositoryFactory.SetDirectionsRepository(
         new InMemoryDirectionTypeRepository());
     ApproachRepositoryFactory.SetApproachRepository(new InMemoryApproachRepository(db));
     ControllerEventLogRepositoryFactory.SetRepository(new InMemoryControllerEventLogRepository(db));
     DetectorRepositoryFactory.SetDetectorRepository(new InMemoryDetectorRepository(db));
 }
Ejemplo n.º 6
0
 public static void InitializeTestDataFor7185Feb012018(InMemoryMOEDatabase db)
 {
     db.ClearTables();
     XmlToListImporter.LoadControllerEventLog("7185Events02_01_2018.Xml", db);
     XmlToListImporter.LoadSignals("signals.xml", db);
     XmlToListImporter.LoadApproaches("approachesfor7185.xml", db);
     XmlToListImporter.LoadDetectors("detectorsFor7185.xml", db);
     XmlToListImporter.AddDetectionTypesToDetectors
         ("DetectorTypesforDetectorsFor7185.xml", db);
     XmlToListImporter.AddDetectionTypesToMetricTypes("mtdt.xml", db);
     MOE.Common.Models.Repositories.SignalsRepositoryFactory.SetSignalsRepository(
         new InMemorySignalsRepository(db));
     MetricTypeRepositoryFactory.SetMetricsRepository(new InMemoryMetricTypeRepository(db));
     ApplicationEventRepositoryFactory.SetApplicationEventRepository(
         new InMemoryApplicationEventRepository(db));
     DirectionTypeRepositoryFactory.SetDirectionsRepository(
         new InMemoryDirectionTypeRepository());
     SpeedEventRepositoryFactory.SetSignalsRepository(new InMemorySpeedEventRepository(db));
     ApproachRepositoryFactory.SetApproachRepository(new InMemoryApproachRepository(db));
     ControllerEventLogRepositoryFactory.SetRepository(new InMemoryControllerEventLogRepository(db));
     DetectorRepositoryFactory.SetDetectorRepository(new InMemoryDetectorRepository(db));
     XmlToListImporter.LoadSpeedEvents("7185speed.xml", db);
 }
Ejemplo n.º 7
0
        public void Initialize()
        {
            _db.ClearTables();
            _db.PopulateMetricTypes();
            _db.PopulateMovementTypes();
            _db.PopulateDirectionTypes();
            _db.PopulateLaneTypes();
            _db.PopulateSignal();
            _db.PopulateRoutes();
            _db.PopulateRegions();

            _db.PopulateRouteWithRouteSignals();
            _db.PopulateRouteSignalsWithPhaseDirection();

            InMemoryRouteRepository routeRepo = new InMemoryRouteRepository(_db);

            MOE.Common.Models.Repositories.RouteRepositoryFactory.SetApproachRouteRepository(routeRepo);
            InMemorySignalsRepository signalRepo = new InMemorySignalsRepository(_db);

            MOE.Common.Models.Repositories.SignalsRepositoryFactory.SetSignalsRepository(signalRepo);
            InMemoryRegionRepository regionRepo = new InMemoryRegionRepository(_db);

            MOE.Common.Models.Repositories.RegionsRepositoryFactory.SetArchivedMetricsRepository(regionRepo);

            InMemoryMetricTypeRepository metricRepo = new InMemoryMetricTypeRepository();

            MOE.Common.Models.Repositories.MetricTypeRepositoryFactory.SetMetricsRepository(metricRepo);
            InMemoryMovementTypeRepository movementRepo = new InMemoryMovementTypeRepository();

            MOE.Common.Models.Repositories.MovementTypeRepositoryFactory.SetMovementTypeRepository(movementRepo);
            InMemoryDirectionTypeRepository directionTypeRepo = new InMemoryDirectionTypeRepository();

            MOE.Common.Models.Repositories.DirectionTypeRepositoryFactory.SetDirectionsRepository(directionTypeRepo);
            InMemoryLaneTypeRepository laneTypeRepo = new InMemoryLaneTypeRepository();

            MOE.Common.Models.Repositories.LaneTypeRepositoryFactory.SetLaneTypeRepository(laneTypeRepo);
        }
Ejemplo n.º 8
0
        public void IndexTest()
        {
            Db.ClearTables();

            var sc = new SignalsController(_controllerTypeRepository, _regionRepository, _directionTypeRepository,
                                           _movementTypeRepository, _laneTypeRepository, _detectionHardwareRepository, _signalsRepository,
                                           _detectorRepository, _detectionTypeRepository, _approachRepository, _metricTypeRepository);

            // Act
            var result = sc.Index() as ViewResult;

            // Assert
            Assert.IsNotNull(result);
        }