예제 #1
0
        public async Task FindPaperUrlAsName()
        {
            AutoWebAccess.AddUriResponse("http://inspirehep.net:80/record/1518295?of=recjson", new FileInfo("1518295.json"));

            // A paper can't be re-read as an actual person just yet.
            var f    = new InSpireContactFinder();
            var info = (await f.FindContactAsync(new Uri("http://inspirehep.net/record/1518295")))
                       .ToArray();
        }
예제 #2
0
        private async void LoadDummyData()
        {
            // Add a simple contact (this will be "improved" when we have somethign real).
            var finder = new InSpireContactFinder();
            var me     = await finder.FindContactAsync(new Uri("http://inspirehep.net/record/983968?ln=en"));

            People.Add(new ContactViewModel(me.First()));
            var david = await finder.FindContactAsync(new Uri("http://inspirehep.net/record/1024481?ln=en"));

            People.Add(new ContactViewModel(david.First()));
            var daniel = await finder.FindContactAsync(new Uri("http://inspirehep.net/record/1020448?ln=en"));

            People.Add(new ContactViewModel(daniel.First()));

            await ContactSync.SyncContactList(new[] { me.First(), david.First(), daniel.First() });

            await ContactSync.SyncContactList(new[] { me.First(), david.First(), daniel.First() });
        }
예제 #3
0
        public async Task InSpireFindGoodURLDW()
        {
            AutoWebAccess.AddUriResponse("http://inspirehep.net:80/record/1020448?ln=en&of=recjson", new FileInfo("1020448.json"));

            var finder = new InSpireContactFinder();
            var info   = (await finder.FindContactAsync(new Uri("http://inspirehep.net/record/1020448?ln=en")))
                         .ToArray();

            Assert.AreEqual(1, info.Length);
            Assert.AreEqual("Daniel O.", info[0].FirstName);
            Assert.AreEqual("Whiteson", info[0].LastName);
        }
예제 #4
0
 public async Task FindBadUrlGoodOtherwise()
 {
     var f    = new InSpireContactFinder();
     var info = (await f.FindContactAsync(new Uri("http://inspirehep.net/search?ln=en&p=find+j+%22Phys.Rev.Lett.%2C105%2A%22")))
                .ToArray();
 }
예제 #5
0
 public async Task FindBadUrlContact()
 {
     var f    = new InSpireContactFinder();
     var info = (await f.FindContactAsync(new Uri("https://www.nytimes.com")))
                .ToArray();
 }