Exemplo n.º 1
0
        public void GetWikiPageByTitle()
        {
            var wikiGateway = new WikipediaGateway(new TraceLogger());

            wikiGateway.Initialize().Wait();
            var results = wikiGateway.GetByPageTitle("aaaaaaaaa", "he").Result;

            Assert.IsNull(results);
        }
Exemplo n.º 2
0
        public void GetWikiPageByLocation()
        {
            var wikiGateway = new WikipediaGateway(new TraceLogger());

            wikiGateway.Initialize().Wait();
            var results = wikiGateway.GetByLocation(new Coordinate(35.12, 31.773), "he").Result;

            Assert.IsTrue(results.Count > 0);
        }
Exemplo n.º 3
0
        public void GetWikiPageById()
        {
            var wikiGateway = new WikipediaGateway(new TraceLogger());

            wikiGateway.Initialize().Wait();
            var results = wikiGateway.GetById("he_104020").Result;

            Assert.IsNotNull(results);
        }
Exemplo n.º 4
0
        public void GetImageUrl()
        {
            var options          = new NonPublicConfigurationData();
            var optionsContainer = Substitute.For <IOptions <NonPublicConfigurationData> >();
            var logger           = Substitute.For <ILogger>();

            optionsContainer.Value.Returns(options);
            var gateway = new WikipediaGateway(optionsContainer, logger);
            var results = gateway.GetImageUrl("File:Israel_Hiking_Map_עין_מחוללים.jpeg").Result;

            Assert.IsNotNull(results);
        }
Exemplo n.º 5
0
        protected override void OnStartup(StartupEventArgs e)
        {
            var gateway = new WikipediaGateway(
                @"https://en.wikipedia.org/w/api.php?action=query&list=geosearch&gsradius=10000&gscoord={0}|{1}&gslimit=50&format=json",
                @"https://en.wikipedia.org/w/api.php?action=query&prop=images&pageids={0}&format=json&imlimit=50");

            var processor = JaroWinklerProcessor.Instance;

            var window = new MainWindow();

            window.DataContext = new MainViewModel(gateway, processor);
            window.Show();

            base.OnStartup(e);
        }
Exemplo n.º 6
0
 public void TestInitialize()
 {
     _gateway = new WikipediaGateway(new TraceLogger());
 }