Esempio 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);
 }
Esempio 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);
        }
Esempio 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);
 }
Esempio 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);
 }
Esempio 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;
 }
Esempio 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;
 }
Esempio 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);
        }
Esempio 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;
 }
Esempio 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);
 }
Esempio 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);
 }
Esempio 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);
 }
Esempio n. 12
0
 public PackagesRestorer(
     ILoadJson jsonLoader,
     IMatchProvider providerMatcher,
     IWriteToConsole consoleWriter,
     SaucySettings settings)
 {
     _jsonLoader      = jsonLoader;
     _providerMatcher = providerMatcher;
     _consoleWriter   = consoleWriter;
     _settings        = settings;
 }
Esempio n. 13
0
 public PackagesRestorer(
 ILoadJson jsonLoader,
 IMatchProvider providerMatcher,
 IWriteToConsole consoleWriter,
 SaucySettings settings)
 {
     _jsonLoader = jsonLoader;
      _providerMatcher = providerMatcher;
      _consoleWriter = consoleWriter;
      _settings = settings;
 }
Esempio 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;
 }
Esempio n. 16
0
 // use this to inject data in for unit testing
 internal void SetMatchProvider(IMatchProvider provider)
 {
     matchProvider = provider;
 }
Esempio n. 17
0
 public ManualMatchResults(IMatchProvider provider, string title, string artist)
 {
     _provider = provider;
     _title    = title;
     _artist   = artist;
 }
Esempio n. 18
0
 public MatchEngine(IMatchProvider <THole, TMatch> matchProvider, IFilter <TMatch> matchFilter)
 {
     _matchProvider = matchProvider;
     _matchFilter   = matchFilter;
 }
Esempio 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;
 }
Esempio n. 21
0
 public MatchCheckerJob(IMatchProvider matchProvider, IOptions <MatchDaysLimitOptions> jobOptions)
 {
     this.matchProvider = matchProvider;
     this.jobOptions    = jobOptions;
 }
 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));
 }
Esempio n. 23
0
 public CacheService(IMatchProvider matchProvider, IBetListProvider betListProvider)
 {
     this.matchProvider   = matchProvider;
     this.betListProvider = betListProvider;
 }
        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);
        }
Esempio 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;
        }
Esempio n. 26
0
 public MatchedNames(IMatchProvider matchProvider)
 {
     this.matchProvider = matchProvider;
 }
Esempio n. 27
0
 public void MatchTestSetUp()
 {
     _matchProvider = new MatchSource();
 }