Example #1
0
        public void TestRealmsAsync()
        {
            var client = new WowClient(TestConstants.TestRegionName, null, null, null);
            var task   = client.GetRealmStatusAsync();
            RealmStatusResponse response = task.Result;

            Assert.IsNotNull(response);
            Assert.IsTrue(new RealmStatusResponse().ToString().Contains('0'));
            Assert.IsNotNull(response.ToString());
            Assert.IsNotNull(response.Realms);
            Assert.IsTrue(response.Realms.Count > 0);
            Assert.IsTrue(response.Realms.Any(r => r.IsPvp));
            Assert.IsTrue(response.Realms.Any(r => r.IsRP));
            Assert.IsTrue(response.Realms.All(r => r.Locale != null));
            Assert.IsTrue(response.Realms.All(r => r.Name != null));
            Assert.IsTrue(!response.Realms.Any(r => r.ToString() == null));
            Assert.IsTrue(response.Realms.All(r => r.Slug != null));
            Assert.IsTrue(response.Realms.All(r => r.BattleGroupName != null));
            Assert.IsTrue(response.Realms.Any(r => r.Status));
            Assert.IsTrue(response.Realms.All(r => r.TimeZone != null));
            Assert.IsTrue(response.Realms.Any(r => r.WinterGrasp != null));

            var tolBarad = response.Realms.Where(r => r.TolBarad != null &&
                                                 r.Status).Select(r => r.TolBarad).FirstOrDefault();

            Assert.IsNotNull(tolBarad);
            Assert.IsTrue(tolBarad.AreaId > 0);
            Assert.IsTrue(tolBarad.ControllingFaction != Faction.Neutral);
            Assert.IsTrue(tolBarad.NextBattleTimeUtc.Year == DateTime.Now.Year);
            Assert.IsTrue(tolBarad.Status != PvpZoneStatus.Unknown);
        }
Example #2
0
        public void TestRealmStatus()
        {
            var client = new WowClient(TestConstants.TestRegion, Properties.Settings.Default.PublicKey, TestConstants.TestLocale);
            var task   = client.GetRealmStatusAsync();
            RealmStatusResponse response = task.Result;

            Assert.IsNotNull(response);
            Assert.IsTrue(new RealmStatusResponse().ToString().Contains('0'));
            Assert.IsNotNull(response.ToString());
            Assert.IsNotNull(response.Realms);
            Assert.IsTrue(response.Realms.Count > 0);
            Assert.IsTrue(response.Realms.Any(r => r.IsPvp));
            Assert.IsTrue(response.Realms.Any(r => r.IsRP));
            Assert.IsTrue(response.Realms.All(r => r.Locale != null));
            Assert.IsTrue(response.Realms.All(r => r.Name != null));
            Assert.IsTrue(!response.Realms.Any(r => r.ToString().Equals(null)));
            Assert.IsTrue(response.Realms.All(r => r.Slug != null));
            Assert.IsTrue(response.Realms.All(r => r.BattleGroupName != null));
            Assert.IsTrue(response.Realms.Any(r => r.Status));
            Assert.IsTrue(response.Realms.All(r => r.TimeZone != null));
        }