コード例 #1
0
        public void ShouldReturnSpicificMapOutOfAll()
        {
            List <Lazy <Map> > maps = GW2Api.V2().Maps.GetAll().ToList();
            Map map = maps[10].Value;

            Assert.AreEqual("Tyria", map.ContinentName);
        }
コード例 #2
0
        public void ShouldReturnSpecificQuagganFromList()
        {
            Dictionary <string, Lazy <Quaggan> > quaggans = GW2Api.V2().Quaggans.GetAll();
            Quaggan cryQuaggan = quaggans["cry"].Value;

            Assert.AreEqual("https://static.staticwars.com/quaggans/cry.jpg", cryQuaggan.Url);
        }
コード例 #3
0
        public void ShouldReturnAllListings()
        {
            var listings = GW2Api.V2().Listings.GetAll();

            //At any given moment there are at least more than 100 listings in the trading post.
            Assert.GreaterOrEqual(listings.Count(), 100);
        }
コード例 #4
0
        public void ShouldReturnSpecificSkinWithDescription()
        {
            const string expectedDescription = "<c=@flavor>After spending so much time cultivating this powerful vine through the generations, it's hard to not feel an attachment to it. Your beloved pet almost cuddles you in its tendrils. Clearly it feels a similar attachment.</c>";
            Skin         skin = GW2Api.V2().Skins.GetById(5544);

            Assert.AreEqual(expectedDescription, skin.Description);
        }
コード例 #5
0
        public void ShoudlReturnMultipleWorldsById()
        {
            List <World> world = GW2Api.V2().Worlds.GetByIds(1001, 2012).ToList();

            CompareWorlds(anvilRock, world[0]);
            CompareWorlds(pikenSquare, world[1]);
        }
コード例 #6
0
        public void ShouldReturnFlag()
        {
            Skin skin = GW2Api.V2().Skins.GetById(5000);

            Assert.AreEqual(new List <SkinFlag> {
                SkinFlag.ShowInWardrobe
            }, skin.Flags);
        }
コード例 #7
0
        public void ShouldReturnAllMinis()
        {
            Dictionary <int, Lazy <Mini> > allMinis = GW2Api.V2().Minis.GetAll();

            Mini actualMini = allMinis[15].Value;

            Assert.AreEqual("Mini Svanir Icebreaker", actualMini.Name);
        }
コード例 #8
0
        public void ShouldReturnCorrectCoin()
        {
            Coin coin = GW2Api.V2().Exchanges.GetCoin(new Money(10000));

            Assert.Greater(coin.AmountOfGems, 0);
            Assert.Greater(coin.CoinsPerGemRaw, 0);
            Assert.NotNull(coin.CoinsPerGemCalculated);
        }
コード例 #9
0
        public void ShouldReturnCorrectBitmap()
        {
            var achievements = GW2Api.V2().Achievements.GetAll();

            Achievement achievement = achievements.Values.Where(x => x.Value.Icon != null).First().Value;

            Assert.NotNull(achievement.GetImage());
        }
コード例 #10
0
 public void ShouldGetSpecificFloor() 
 {
     Continent continent = GW2Api.V2().Continents.GetById(1);
     Floor floor = continent.Floors[2].Value;
     Assert.AreEqual(32768, floor.Dimension.X);
     Assert.AreEqual(32768, floor.Dimension.Y);
     Assert.GreaterOrEqual(floor.Regions.Count(), 7);
 }
コード例 #11
0
        public void ShouldReturnItemWithRestrictions()
        {
            Skin skin = GW2Api.V2().Skins.GetById(263);

            Assert.AreEqual(new List <Restriction> {
                Restriction.Asura
            }, skin.Restrictions);
        }
コード例 #12
0
        public void ShouldReturnAllAchievements()
        {
            var achievements = GW2Api.V2().Achievements.GetAll();
            int id           = achievements.Keys.Last();

            Achievement achievement = achievements[id].Value;

            AssertThatAchievementIsCorrectlyFilled(achievement, id);
        }
コード例 #13
0
        public void ShouldReturnAllColors()
        {
            Dictionary <int, Lazy <Color> > allColors = GW2Api.V2().Colors.GetAll();

            Color actualColor = allColors[1].Value;

            Assert.AreEqual("Dye Remover", actualColor.Name);
            Assert.GreaterOrEqual(allColors.Count(), 480);
        }
コード例 #14
0
        public void ShouldReturnCorrectGem()
        {
            Gem gem = GW2Api.V2().Exchanges.GetGem(8000);

            Assert.NotNull(gem.AmountOfCoinsCalculated);
            Assert.NotNull(gem.CoinsPerGemCalculated);
            Assert.Greater(gem.AmountOfCoinsRaw, 0);
            Assert.Greater(gem.CoinsPerGemRaw, 0);
        }
コード例 #15
0
        public void ShouldReturnSpecificAchievement()
        {
            var achievements = GW2Api.V2().Achievements.GetAll();
            int id           = achievements.Keys.First();

            var achievement = GW2Api.V2().Achievements.Get(id);

            AssertThatAchievementIsCorrectlyFilled(achievement, id);
        }
コード例 #16
0
        public void ShouldReturnMultiple()
        {
            var keys = GW2Api.V2().Achievements.GetAll().Keys.ToList();

            var achievements = GW2Api.V2().Achievements.GetMultiple(RequestedLanguage.En, keys[0], keys[1]);

            AssertThatAchievementIsCorrectlyFilled(achievements[keys[0]].Value, keys[0]);
            AssertThatAchievementIsCorrectlyFilled(achievements[keys[1]].Value, keys[1]);
        }
コード例 #17
0
        public void ShouldReturnAllItems()
        {
            Dictionary <int, Lazy <Item> > allItems = GW2Api.V2().Items.GetAll();

            Item actualItem = allItems[15].Value;

            Assert.AreEqual("Abomination Hammer", actualItem.Name);
            Assert.GreaterOrEqual(allItems.Count(), 40000);
        }
コード例 #18
0
 public void ShouldGetSpecificContinent() 
 {
     Continent continent = GW2Api.V2().Continents.GetById(1);
     Assert.AreEqual("Tyria", continent.Name);
     Assert.AreEqual(32768, continent.Dimension.X);
     Assert.AreEqual(32768, continent.Dimension.Y);
     Assert.AreEqual(0, continent.MinZoom);
     Assert.AreEqual(7, continent.MaxZoom);
     Assert.AreEqual(1, continent.Id);
 }
コード例 #19
0
        public void ShouldReturnSpecificAchievementInLanguage()
        {
            var achievements = GW2Api.V2().Achievements.GetAll();
            int id           = achievements.Keys.First();

            var achievementEn = GW2Api.V2().Achievements.Get(id);
            var achievementDe = GW2Api.V2(RequestedLanguage.De).Achievements.Get(id, RequestedLanguage.De);

            Assert.That(achievementEn.Name, Is.Not.EqualTo(achievementDe.Name));
        }
コード例 #20
0
        public void ShouldReturnAllMatches()
        {
            var matches = GW2Api.V2().WvWMatches.GetAll();

            Assert.IsNotNull(matches);
            Assert.Greater(matches.Count(), 0);
            var singleMatch = matches.First();

            Assert.IsNotNull(singleMatch.Value.Id);
        }
コード例 #21
0
        public void ShouldReturnAllObjectives()
        {
            var objectives = GW2Api.V2().WvWObjectives.GetAll();

            Assert.IsNotNull(objectives);
            Assert.Greater(objectives.Count(), 0);
            var objective = objectives.First().Value;

            Assert.IsNotNullOrEmpty(objective.Id);
        }
コード例 #22
0
        public void ShouldLoadCorrectMini()
        {
            Mini actualMini = GW2Api.V2().Minis.Get(355);

            Assert.AreEqual(355, actualMini.Id);
            Assert.AreEqual(76670, actualMini.ItemId);
            Assert.AreEqual("Mini Mister Mittens", actualMini.Name);
            Assert.AreEqual(0, actualMini.Order);
            Assert.AreEqual("Combine 3 Mini Professor Mews in the Mystic Forge with a pile of crystalline dust, an obsidian shard, and an amber quantic dipole (dropped by creatures in scale 1–20 fractals).", actualMini.Unlock);
        }
コード例 #23
0
        public void ShouldGetSpecificRegion()
        {
            Continent continent = GW2Api.V2().Continents.GetById(1);
            Floor floor = continent.Floors[2].Value;
            Region region = floor.Regions["1"];

            Assert.GreaterOrEqual(region.Maps.Count(), 10);
            Assert.AreEqual("Shiverpeak Mountains", region.Name);
            Assert.AreEqual(19840, region.Coordinate.X);
            Assert.AreEqual(13568, region.Coordinate.Y);
        }
コード例 #24
0
        public void ShouldGetSpecificSkillChallenge()
        {
            Continent continent = GW2Api.V2().Continents.GetById(1);
            Floor floor = continent.Floors[2].Value;
            Region region = floor.Regions["1"];
            Map map = region.Maps["26"];
            SkillChallenge skillChallange = map.SkillChallenges.First();

            Assert.AreEqual(20381.6m, skillChallange.Coordinate.X);
            Assert.AreEqual(16613.8m, skillChallange.Coordinate.Y);
        }
コード例 #25
0
        public void ShouldReturnObjective()
        {
            var objective = GW2Api.V2().WvWObjectives.GetById("38-6");

            Assert.AreEqual("Speldan Clearcut", objective.Name);
            Assert.AreEqual(844, objective.SectorId);
            Assert.IsNotNull(objective.Coord);
            Assert.AreEqual(9841.05f, objective.Coord[0]);
            Assert.AreEqual(13545.8f, objective.Coord[1]);
            Assert.AreEqual(-508.295f, objective.Coord[2]);
        }
コード例 #26
0
        public void ShouldReturnSingleColor()
        {
            Color actualColor = GW2Api.V2().Colors.GetById(10);

            Assert.AreEqual(skyColor.Id, actualColor.Id);
            Assert.AreEqual(skyColor.Name, actualColor.Name);
            Assert.AreEqual(skyColor.BaseRGB, actualColor.BaseRGB);
            Assert.NotNull(actualColor.Cloth);
            Assert.NotNull(actualColor.Leather);
            Assert.NotNull(actualColor.Metal);
        }
コード例 #27
0
        public void ShouldReturnCorrectColorsOnPage()
        {
            Color actualColor = GW2Api.V2().Colors.GetByPage(9, 1).ToList()[0];

            Assert.AreEqual(skyColor.Id, actualColor.Id);
            Assert.AreEqual(skyColor.Name, actualColor.Name);
            Assert.AreEqual(skyColor.BaseRGB, actualColor.BaseRGB);
            Assert.NotNull(actualColor.Cloth);
            Assert.NotNull(actualColor.Leather);
            Assert.NotNull(actualColor.Metal);
        }
コード例 #28
0
        public void ShouldReturnCorrectAccount()
        {
            Account account = GW2Api.V2().Account.Get("D0F26FAD-FAC1-E649-A177-CFEC0297C5B49AF875D9-CFC7-434B-8FF1-DC11D0B4A65D");

            Assert.AreEqual(account.Access, AccountType.GuildWars2);
            Assert.AreEqual(account.Created, new DateTime(2015, 8, 5, 21, 51, 00));
            Assert.GreaterOrEqual(account.FractalLevel, 7);
            Assert.GreaterOrEqual(account.Guilds.Count(), 1);
            Assert.GreaterOrEqual(account.Id, Guid.Parse("907e7008bc3be511a22a78e7d1936ef0"));
            Assert.GreaterOrEqual(account.Name, "Pantsu.1537");
            Assert.GreaterOrEqual(account.World.Name, "Vizunah Sqaure [FR]");
        }
コード例 #29
0
        public void ShouldReturnMatch()
        {
            var match = GW2Api.V2().WvWMatches.GetById("1-3");

            Assert.IsNotNull(match.Scores);
            Assert.IsNotNull(match.Worlds);
            Assert.IsNotNull(match.Deaths);
            Assert.IsNotNull(match.Kills);
            Assert.IsNotNull(match.Maps);
            Assert.Greater(match.Maps.Count, 0);
            Assert.IsNotNull(match.Maps[1].Type);
        }
コード例 #30
0
        public void ShouldReturnCorrectCurrency()
        {
            Currency expectedCurrency = new Currency(4, "Gem", "Purchased and spent via the Black Lion Trading Company.", 100, "https://render.guildwars2.com/file/220061640ECA41C0577758030357221B4ECCE62C/502065.png");

            Currency actualCurrency = GW2Api.V2().Currencies.Get(CurrencyType.Gem);

            Assert.AreEqual(expectedCurrency.Id, actualCurrency.Id);
            Assert.AreEqual(expectedCurrency.Name, actualCurrency.Name);
            Assert.AreEqual(expectedCurrency.Description, actualCurrency.Description);
            Assert.AreEqual(expectedCurrency.Order, actualCurrency.Order);
            Assert.AreEqual(expectedCurrency.Icon, actualCurrency.Icon);
        }