Exemple #1
0
        public void CreatePurdueSplitFailureAggregationChartTest()
        {
            MOE.CommonTests.Models.InMemoryMOEDatabase _db = new InMemoryMOEDatabase();
            _db.PopulateSignal();
            _db.PopulateSignalsWithApproaches();
            _db.PopulateApproachesWithDetectors();
            //int apprId = _db.PopulateApproachSplitFailAggregationsWithRandomRecords();

            MOE.CommonTests.Models.InMemoryApproachSplitFailAggregationRepository asfs = new InMemoryApproachSplitFailAggregationRepository(_db);



            MOE.Common.Models.Repositories.ApproachSplitFailAggregationRepositoryFactory.SetApplicationEventRepository(asfs);

            //Chart chart = ChartFactory.CreatePurdueSplitFailureAggregationChart(options);

            //Assert.IsNotNull(chart);

            string path = @"c:\SPMImages\testchart" + DateTime.Now.Month.ToString() + "_" + DateTime.Now.Day.ToString()
                          + "_" + DateTime.Now.Hour.ToString() + "_" + DateTime.Now.Minute.ToString() + ".jpeg";

            //chart.SaveImage(path);

            Assert.IsTrue(File.Exists(path));
        }
Exemple #2
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();
        }
        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();
        }
Exemple #5
0
        public void ExporterTest()
        {
            InMemoryMOEDatabase _db = new InMemoryMOEDatabase();

            _db.PopulateSignal();
            _db.PopulateSignalsWithApproaches();
            _db.PopulateApproachesWithDetectors();
            //_db.PopulateApproachSplitFailAggregationsWithRandomRecords();

            var recordList = from r in _db.ApproachSplitFailAggregations select r;

            string filepath = @"c:\temp\recordsExport.csv";


            var exporter = new Exporter();

            Assert.IsTrue(File.Exists(filepath));
        }