public HappyPath() { var logger = new Mock <ILogger>(); var crawlJobData = new HubSpotCrawlJobData(HubSpotConfiguration.Create()); _sut = new CluedIn.Crawling.HubSpot.Infrastructure.HubSpotClient(logger.Object, crawlJobData, new RestClient()); }
protected HubSpotProviderTest() { Container = new Mock <IWindsorContainer>(); SystemContext = new Mock <SystemContext>(Container.Object); NameClientFactory = new Mock <IHubSpotClientFactory>(); ApplicationContext = new ApplicationContext(Container.Object); Logger = new Mock <ILogger>(); Configuration = HubSpotConfiguration.Create(); CrawlJobData = new HubSpotCrawlJobData(Configuration); Client = new Mock <HubSpotClient>(Logger.Object, CrawlJobData, new RestClient()); Sut = new CluedIn.Provider.HubSpot.HubSpotProvider(ApplicationContext, NameClientFactory.Object, Logger.Object, null); NameClientFactory.Setup(n => n.CreateNew(It.IsAny <HubSpotCrawlJobData>())).Returns(() => Client.Object); }
public GetDataTests() { var nameClientFactory = new Mock <IHubSpotClientFactory>(); _clientMock = new Mock <IHubSpotClient>(); _clientMock .Setup(x => x.GetSettingsAsync()) .Returns(Task.FromResult(new Settings())); _logMock = new Mock <ILogger>(); nameClientFactory.Setup(x => x.CreateNew(It.IsAny <HubSpotCrawlJobData>())).Returns(_clientMock.Object); _sut = new CluedIn.Crawling.HubSpot.Crawler(nameClientFactory.Object, _logMock.Object); _crawlJobData = new HubSpotCrawlJobData(HubSpotConfiguration.Create()); }
//private readonly ITestOutputHelper _outputHelper; public HubSpotTestFixture() { //_outputHelper = new TestOutputHelper(); var executingFolder = new FileInfo(Assembly.GetExecutingAssembly().CodeBase.Substring(8)).DirectoryName; //_outputHelper.WriteLine($"Creating crawler host {HubSpotConstants.ProviderName} from folder {executingFolder}"); var crawlerHost = new TestCrawlerHost(executingFolder, HubSpotConstants.ProviderName); crawlerHost.ContainerInstance.Install(new VocabulariesInstaller()); ClueStorage = new ClueStorage(); crawlerHost.ProcessClue += CrawlerHost_ProcessClue; var credentials = HubSpotConfiguration.Create(); //_outputHelper.WriteLine($"Executing crawler host {HubSpotConstants.ProviderName} ({HubSpotConstants.ProviderId}) with credentials {JsonConvert.SerializeObject(credentials)}"); crawlerHost.Execute(credentials, HubSpotConstants.ProviderId); //_outputHelper.WriteLine($"Executing crawler host {HubSpotConstants.ProviderName} completed"); }
public GetHelperConfigurationBehaviour() { _jobData = new HubSpotCrawlJobData(HubSpotConfiguration.Create()); }