public void GetTodayInWow_GettingTodayInWowFromWowhead_ReceivedCorrectly()
        {
            //Arrange
            var target = new WowheadClient();

            //Act
            var result = target.GetTodayInWow();

            //Assert
            Assert.IsNotNull(result);
        }
 private void GetGameObjectsLocales(IEnumerable<MangosTEx.Services.Models.GameObject> gameObjects)
 {
     CultureInfo culture = Settings.LocalizationCulture;
     IDataProvider provider = DataProviderManager.GetSimpleHttpProvider();
     Parallel.ForEach(gameObjects, go =>
     {
         var grabber = new WowheadClient(provider, culture);
         try
         {
             var loc = grabber.GetGameObject(go.Id);
             UpdateGameObjectLocaleEvent.Invoke(this, new LocaleGameObjectEventArgs(loc));
         }
         catch { }
     });
     UpdateGameObjectLocaleEvent -= OnUpdateGameObjectLocale;
 }
        private void GetGameObjectsLocales(IEnumerable <MangosTEx.Services.Models.GameObject> gameObjects)
        {
            CultureInfo   culture  = Settings.LocalizationCulture;
            IDataProvider provider = DataProviderManager.GetSimpleHttpProvider();

            Parallel.ForEach(gameObjects, go =>
            {
                var grabber = new WowheadClient(provider, culture);
                try
                {
                    var loc = grabber.GetGameObject(go.Id);
                    UpdateGameObjectLocaleEvent.Invoke(this, new LocaleGameObjectEventArgs(loc));
                }
                catch { }
            });
            UpdateGameObjectLocaleEvent -= OnUpdateGameObjectLocale;
        }
Beispiel #4
0
        private void GetLocalesAsync(IEnumerable <LocalizedQuest> items)
        {
            CultureInfo   culture  = Settings.LocalizationCulture;
            IDataProvider provider = DataProviderManager.GetSimpleHttpProvider();
            var           grabber  = new WowheadClient(provider, culture);

            Observable.Start(() =>
                             Parallel.ForEach(items, item =>
            {
                try
                {
                    // update translated item
                    item.TranslatedEntity = grabber.GetQuest(item.DatabaseEntity.Id);
                }
                catch (Exception ex)
                {
                    // if we got an error, keep it to investigate
                    item.Error = ex.Message;
                }
            }));
        }
Beispiel #5
0
 public ItemProvider(ItemCache itemCache, WowheadClient wowheadClient)
 {
     _itemCache     = itemCache;
     _wowheadClient = wowheadClient;
 }
 private void GetLocalesAsync(IEnumerable<LocalizedQuest> items)
 {
     CultureInfo culture = Settings.LocalizationCulture;
     IDataProvider provider = DataProviderManager.GetSimpleHttpProvider();
     var grabber = new WowheadClient(provider, culture);
     Observable.Start(() =>
         Parallel.ForEach(items, item =>
             {
                 try
                 {
                     // update translated item
                     item.TranslatedEntity = grabber.GetQuest(item.DatabaseEntity.Id);
                 }
                 catch (Exception ex)
                 {
                     // if we got an error, keep it to investigate
                     item.Error = ex.Message;
                 }
             }));
 }
Beispiel #7
0
 public void GenerateTodayInWow_GeneratingAndSendingEmbed_EmbedSentCorrectly()
 {
     var whclient = new WowheadClient();
     //var service = new TodayInWoWService(whclient);
 }