/// <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); }
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); }
/// <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); }
public MatchController(IBetListProvider betListProvider, IMatchProvider matchProvider, ITeamProvider teamProvider, ICacheService cacheService) { this.betListProvider = betListProvider; this.matchProvider = matchProvider; this.teamProvider = teamProvider; this.cacheService = cacheService; }
public HomeController(IDbContextWrapper context, IMatchProvider matchProvider, IEmailController emailController, IViewMessageFactory viewMessageFactory) { this.context = context; this.matchProvider = matchProvider; this.emailController = emailController; this.viewMessageFactory = viewMessageFactory; }
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); }
public SortController(IBetListProvider rateListProvider, IMatchProvider matchProvider, IUserProvider userProvider, ICacheService cacheService) { this.betListProvider = rateListProvider; this.matchProvider = matchProvider; this.userProvider = userProvider; this.cacheService = cacheService; }
public Coder( IEnumerable<GazetteerRecord> gazzetteerRecords, IMatchProvider matchProvider) { this.gazzetteerRecords = gazzetteerRecords; this.matchProvider = matchProvider; matchedNamesCache = new MatchedNamesCache(matchProvider); dictionary = new GazetteerDataDictionaries(this.gazzetteerRecords); }
public Coder( IEnumerable <GazetteerRecord> gazzetteerRecords, IMatchProvider matchProvider) { this.gazzetteerRecords = gazzetteerRecords; this.matchProvider = matchProvider; matchedNamesCache = new MatchedNamesCache(matchProvider); dictionary = new GazetteerDataDictionaries(this.gazzetteerRecords); }
public PackagesRestorer( ILoadJson jsonLoader, IMatchProvider providerMatcher, IWriteToConsole consoleWriter, SaucySettings settings) { _jsonLoader = jsonLoader; _providerMatcher = providerMatcher; _consoleWriter = consoleWriter; _settings = settings; }
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; }
// use this to inject data in for unit testing internal void SetMatchProvider(IMatchProvider provider) { matchProvider = provider; }
public ManualMatchResults(IMatchProvider provider, string title, string artist) { _provider = provider; _title = title; _artist = artist; }
public MatchEngine(IMatchProvider <THole, TMatch> matchProvider, IFilter <TMatch> matchFilter) { _matchProvider = matchProvider; _matchFilter = matchFilter; }
public ConfirmationPeriodJob(IDbContextWrapper context, IMatchProvider matchProvider, IOptions <ConfirmationPeriodOptions> jobOptions) { this.jobOptions = jobOptions; this.context = context; this.matchProvider = matchProvider; }
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)); }
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); }
// 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; }
public MatchedNames(IMatchProvider matchProvider) { this.matchProvider = matchProvider; }
public void MatchTestSetUp() { _matchProvider = new MatchSource(); }