Exemplo n.º 1
1
 /// <summary>
 /// Initializes a new instance of the <see cref="GeoCoder"/> class.
 /// </summary>
 public GeoCoder()
 {
     dbConnection = InitialiseDbConnection();
     matchProvider = new MatchProvider(dbConnection);
     columnsMappingProvider = new ColumnsMappingProvider(dbConnection);
     matchedNames = new MatchedNames(matchProvider);
 }
Exemplo n.º 2
0
        public MatchEngineFactory(IMatchStrategy <THole, TFill, TMatch> matchStrategy, IFillProvider <TFill> fillProvider, IFilterStrategyFactory <THole, TFill> filterStrategyProvider, IFilter <TMatch> matchFilter)
        {
            _matchFilter = matchFilter;
            var fillProviderFactory = new FilteredFillProviderFactory <THole, TFill>(fillProvider, filterStrategyProvider);

            _matchProvider = new MatchProvider <THole, TFill, TMatch>(matchStrategy, fillProviderFactory);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GeoCoder"/> class.
 /// Use this constructor for unit testing.
 /// </summary>
 /// <param name="dbConnection">The database connection.</param>
 internal GeoCoder(DbConnection dbConnection)
 {
     this.dbConnection      = dbConnection;
     matchProvider          = new MatchProvider(dbConnection);
     columnsMappingProvider = new ColumnsMappingProvider(dbConnection);
     matchedNames           = new MatchedNames(matchProvider);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GeoCoder"/> class.
 /// </summary>
 public GeoCoder()
 {
     dbConnection           = InitialiseDbConnection();
     matchProvider          = new MatchProvider(dbConnection);
     columnsMappingProvider = new ColumnsMappingProvider(dbConnection);
     matchedNames           = new MatchedNames(matchProvider);
 }
Exemplo n.º 5
0
 public MatchController(IBetListProvider betListProvider, IMatchProvider matchProvider, ITeamProvider teamProvider, ICacheService cacheService)
 {
     this.betListProvider = betListProvider;
     this.matchProvider   = matchProvider;
     this.teamProvider    = teamProvider;
     this.cacheService    = cacheService;
 }
Exemplo n.º 6
0
 public HomeController(IDbContextWrapper context, IMatchProvider matchProvider, IEmailController emailController, IViewMessageFactory viewMessageFactory)
 {
     this.context            = context;
     this.matchProvider      = matchProvider;
     this.emailController    = emailController;
     this.viewMessageFactory = viewMessageFactory;
 }
Exemplo n.º 7
0
        public void TestInitialize()
        {
            matchClient     = new Mock <IMatchClient>();
            matchService    = new Mock <Data.Services.IMatchService>();
            betListProvider = new Mock <IBetListProvider>();
            matchService.Setup(m => m.GetMatchBySportDateStatus(It.IsAny <int>(), It.IsAny <string>(), It.IsAny <int>()))
            .Returns((int sport, string dateMatch, int status) => {
                IEnumerable <Common.Models.Match> matches = GetMatches();
                if (sport == 0 && dateMatch == "" && status == 0)
                {
                    return(GetMatches().ToArray());
                }
                if (sport > 0)
                {
                    matches = matches.Where(m => m.SportId == sport);
                    return(matches.ToArray());
                }
                if (status == 3)
                {
                    matches = matches.Where(m => m.Date > DateTime.Now);
                    return(matches.ToArray());
                }
                if (dateMatch != "")
                {
                    DateTime date = DateTime.Parse(dateMatch).Date;
                    matches       = matches.Where(m => m.Date.Date == date);
                    return(matches.ToArray());
                }

                throw new ArgumentException();
            });
            matchProvider = new MatchProvider(matchClient.Object, matchService.Object, betListProvider.Object);
        }
Exemplo n.º 8
0
 public SortController(IBetListProvider rateListProvider, IMatchProvider matchProvider, IUserProvider userProvider, ICacheService cacheService)
 {
     this.betListProvider = rateListProvider;
     this.matchProvider   = matchProvider;
     this.userProvider    = userProvider;
     this.cacheService    = cacheService;
 }
Exemplo n.º 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GeoCoder"/> class.
 /// Use this constructor for unit testing.
 /// </summary>
 /// <param name="dbConnection">The database connection.</param>
 internal GeoCoder(DbConnection dbConnection)
 {
     this.dbConnection = dbConnection;
     matchProvider = new MatchProvider(dbConnection);
     columnsMappingProvider = new ColumnsMappingProvider(dbConnection);
     matchedNames = new MatchedNames(matchProvider);
 }
Exemplo n.º 10
0
 public Coder(
     IEnumerable<GazetteerRecord> gazzetteerRecords,
     IMatchProvider matchProvider)
 {
     this.gazzetteerRecords = gazzetteerRecords;
     this.matchProvider = matchProvider;
     matchedNamesCache = new MatchedNamesCache(matchProvider);
     dictionary = new GazetteerDataDictionaries(this.gazzetteerRecords);
 }
Exemplo n.º 11
0
 public Coder(
     IEnumerable <GazetteerRecord> gazzetteerRecords,
     IMatchProvider matchProvider)
 {
     this.gazzetteerRecords = gazzetteerRecords;
     this.matchProvider     = matchProvider;
     matchedNamesCache      = new MatchedNamesCache(matchProvider);
     dictionary             = new GazetteerDataDictionaries(this.gazzetteerRecords);
 }
Exemplo n.º 12
0
 public PackagesRestorer(
     ILoadJson jsonLoader,
     IMatchProvider providerMatcher,
     IWriteToConsole consoleWriter,
     SaucySettings settings)
 {
     _jsonLoader      = jsonLoader;
     _providerMatcher = providerMatcher;
     _consoleWriter   = consoleWriter;
     _settings        = settings;
 }
Exemplo n.º 13
0
 public PackagesRestorer(
 ILoadJson jsonLoader,
 IMatchProvider providerMatcher,
 IWriteToConsole consoleWriter,
 SaucySettings settings)
 {
     _jsonLoader = jsonLoader;
      _providerMatcher = providerMatcher;
      _consoleWriter = consoleWriter;
      _settings = settings;
 }
Exemplo n.º 14
0
        public Downloader(MainViewModel mainViewModel,
                          IBuildProvider buildProvider, IMatchProvider matchProvider, ISoftwareProvider softwareProvider, IDownloadProvider downloadProvider,
                          IDownloadService downloadService, IExtractService extractService, IMetadataService metadataService, ILogger <Downloader> logger)
        {
            Logger = logger;

            MainViewModel = mainViewModel;

            BuildProvider    = buildProvider;
            MatchProvider    = matchProvider;
            SoftwareProvider = softwareProvider;
            DownloadProvider = downloadProvider;

            DownloadService = downloadService;
            ExtractService  = extractService;
            MetadataService = metadataService;
        }
 public MatchController(IMatchProvider matchProvider, DatabaseContext databaseContext)
 {
     _matchProvider   = matchProvider;
     _databaseContext = databaseContext;
 }
Exemplo n.º 16
0
 // use this to inject data in for unit testing
 internal void SetMatchProvider(IMatchProvider provider)
 {
     matchProvider = provider;
 }
Exemplo n.º 17
0
 public ManualMatchResults(IMatchProvider provider, string title, string artist)
 {
     _provider = provider;
     _title    = title;
     _artist   = artist;
 }
Exemplo n.º 18
0
 public MatchEngine(IMatchProvider <THole, TMatch> matchProvider, IFilter <TMatch> matchFilter)
 {
     _matchProvider = matchProvider;
     _matchFilter   = matchFilter;
 }
Exemplo n.º 19
0
 // use this to inject data in for unit testing
 internal void SetMatchProvider(IMatchProvider provider)
 {
     matchProvider = provider;
 }
 public ConfirmationPeriodJob(IDbContextWrapper context, IMatchProvider matchProvider, IOptions <ConfirmationPeriodOptions> jobOptions)
 {
     this.jobOptions    = jobOptions;
     this.context       = context;
     this.matchProvider = matchProvider;
 }
Exemplo n.º 21
0
 public MatchCheckerJob(IMatchProvider matchProvider, IOptions <MatchDaysLimitOptions> jobOptions)
 {
     this.matchProvider = matchProvider;
     this.jobOptions    = jobOptions;
 }
Exemplo n.º 22
0
 private static void AssertNoSavesCalled(IMatchProvider mock)
 {
     mock.AssertWasNotCalled(
         x => x.SaveMatchLevel1(Arg<string>.Is.Anything, Arg<string>.Is.Anything));
     mock.AssertWasNotCalled(
         x =>
             x.SaveMatchLevel2(
                 Arg<string>.Is.Anything,
                 Arg<string>.Is.Anything,
                 Arg<string>.Is.Anything));
     mock.AssertWasNotCalled(
         x =>
             x.SaveMatchLevel3(
                 Arg<string>.Is.Anything,
                 Arg<string>.Is.Anything,
                 Arg<string>.Is.Anything,
                 Arg<string>.Is.Anything));
 }
Exemplo n.º 23
0
 public CacheService(IMatchProvider matchProvider, IBetListProvider betListProvider)
 {
     this.matchProvider   = matchProvider;
     this.betListProvider = betListProvider;
 }
Exemplo n.º 24
0
        public IMatchProvider MatchProvider()
        {
            IMatchProvider matchStub =
                MockRepository.GenerateStub <IMatchProvider>();

            // get all matches
            matchStub.Stub(x => x.GetAllLevel1())
            .Return(matchProviderTestData.AllLevel1());
            matchStub.Stub(
                x => x.GetAllLevel2())
            .Return(matchProviderTestData.AllLevel2());
            matchStub.Stub(
                x =>
                x.GetAllLevel3())
            .Return(matchProviderTestData.AllLevel3());

            // single level1 match
            matchStub.Stub(x => x.GetMatches(Alternate[0]))
            .Return(
                matchProviderTestData.Level1Matches
                    (Alternate[0]));

            // single level2 match
            matchStub.Stub(
                x => x.GetMatches(
                    Alternate[1],
                    Actual[0]))
            .Return(
                matchProviderTestData.Level2Matches(
                    Actual[0],
                    Alternate[1]));

            // single level3 match
            matchStub.Stub(
                x =>
                x.GetMatches(
                    Alternate[2],
                    Actual[0],
                    Actual[1]))
            .Return(
                matchProviderTestData.Level3Matches(
                    Actual[0],
                    Actual[1],
                    Alternate[2]));

            // provide default empty lists if no records found

            //  default empty list if no level 1 match
            matchStub.Stub(x => x.GetMatches(Arg <string> .Is.Anything))
            .Return(
                matchProviderTestData.EmptyLevel1List());

            //  default  empty list if no level 2 match
            matchStub.Stub(
                x => x.GetMatches(
                    Arg <string> .Is.Anything,
                    Arg <string> .Is.Anything))
            .Return(
                matchProviderTestData.EmptyLevel2List());

            // default  empty list if no level3 match
            matchStub.Stub(
                x =>
                x.GetMatches(
                    Arg <string> .Is.Anything,
                    Arg <string> .Is.Anything,
                    Arg <string> .Is.Anything))
            .Return(
                matchProviderTestData.EmptyLevel3List());

            return(matchStub);
        }
Exemplo n.º 25
0
        // this is to indicate to the users that a match that has come from the db

        #endregion Fields

        #region Constructors

        public MatchedNames(IMatchProvider matchProvider)
        {
            this.matchProvider = matchProvider;
        }
Exemplo n.º 26
0
 public MatchedNames(IMatchProvider matchProvider)
 {
     this.matchProvider = matchProvider;
 }
Exemplo n.º 27
0
 public void MatchTestSetUp()
 {
     _matchProvider = new MatchSource();
 }