Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
            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());
            }
Ejemplo n.º 4
0
        //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");
        }
Ejemplo n.º 5
0
 public GetHelperConfigurationBehaviour()
 {
     _jobData = new HubSpotCrawlJobData(HubSpotConfiguration.Create());
 }