Example #1
0
        public void RunTest()
        {
            var cache = new MockCache();

            var connectionStringBuilder = new SqliteConnectionStringBuilder()
            {
                DataSource = ":memory:"
            };
            string connectionString        = connectionStringBuilder.ToString();
            var    connection              = new SqliteConnection(connectionString);
            var    dbContextOptionsBuilder = new DbContextOptionsBuilder <IffleyRoutesRecordContext>();

            dbContextOptionsBuilder.UseSqlite(connection);
            var repository = new IffleyRoutesRecordContext(dbContextOptionsBuilder.Options);

            repository.Database.OpenConnection();
            repository.Database.EnsureCreated();

            var styleSymbolManager = new StyleSymbolManager(repository, cache);
            var ruleManager        = new RuleManager(repository, cache);
            var holdManager        = new HoldManager(repository, cache, ruleManager);
            var gradeManager       = new GradeManager(repository, cache);
            var problemReader      = new ProblemReader(repository, cache, styleSymbolManager, ruleManager, holdManager, gradeManager);
            var validator          = new ProblemRequestValidator(repository);

            var staticDataPopulater = new PopulateDatabaseWithStaticData(repository, existingDataFilePath);

            staticDataPopulater.Populate();

            var populator = new PopulateDatabaseWithExistingProblems(repository, existingDataFilePath, validator);

            populator.Populate(false);
        }
 public ProblemCreator(IffleyRoutesRecordContext repository, IMemoryCache cache,
                       ProblemReader problemReader, ProblemRequestValidator validator)
 {
     this.repository    = repository;
     this.cache         = cache;
     this.problemReader = problemReader;
     this.validator     = validator;
 }
Example #3
0
 public ProblemReader(IffleyRoutesRecordContext repository, IMemoryCache cache, StyleSymbolManager styleSymbolManager,
                      RuleManager ruleManager, HoldManager holdManager, IGradeManager gradeManager)
 {
     this.repository         = repository;
     this.cache              = cache;
     this.styleSymbolManager = styleSymbolManager;
     this.ruleManager        = ruleManager;
     this.holdManager        = holdManager;
     this.gradeManager       = gradeManager;
 }
Example #4
0
 public HoldManager(IffleyRoutesRecordContext repository, IMemoryCache cache, RuleManager ruleManager)
 {
     this.repository  = repository;
     this.cache       = cache;
     this.ruleManager = ruleManager;
 }
Example #5
0
 public IssueRequestValidator(IffleyRoutesRecordContext repository)
 {
     this.repository = repository;
 }
Example #6
0
 public GradeManager(IffleyRoutesRecordContext repository, IMemoryCache cache)
 {
     this.repository = repository;
     this.cache      = cache;
 }
 public PopulateDatabaseWithExistingProblems(IffleyRoutesRecordContext repository, string existingDataPath, ProblemRequestValidator validator)
 {
     this.repository       = repository;
     this.existingDataPath = existingDataPath;
     this.validator        = validator;
 }
Example #8
0
 public PopulateDatabaseWithStaticData(IffleyRoutesRecordContext repository, string existingDataPath)
 {
     this.repository       = repository;
     this.existingDataPath = existingDataPath;
 }
Example #9
0
 public IssueManager(IffleyRoutesRecordContext repository, ProblemReader problemReader, IssueRequestValidator validator)
 {
     this.repository    = repository;
     this.problemReader = problemReader;
     this.validator     = validator;
 }