Exemple #1
0
        public void GetArtisanFromSlug()
        {
            var mock = new Mock <ID3DataProvider>();

            mock.Setup(p => p.FetchData("https://eu.api.battle.net/d3/data/artisan/whatsoever?locale=en&apikey=" + D3Api.ApiKey))
            .Returns <string>(p => new MemoryStream(Encoding.Default.GetBytes(JsonConvert.SerializeObject(new Artisan()))));
            D3Api.DataProvider = mock.Object;

            var obj = D3Api.GetArtisanFromSlug("whatsoever");

            Assert.IsNotNull(obj);
        }
Exemple #2
0
        public void GetHeroFromHeroId()
        {
            var mock = new Mock <ID3DataProvider>();

            mock.Setup(p => p.FetchData("https://eu.api.battle.net/d3/profile/tok-2360/hero/whatsoever?locale=en&apikey=" + D3Api.ApiKey))
            .Returns <string>(p => new MemoryStream(Encoding.Default.GetBytes(JsonConvert.SerializeObject(new Hero()))));
            D3Api.DataProvider = mock.Object;

            var obj = D3Api.GetHeroFromHeroId(battleTag, "whatsoever");

            Assert.IsNotNull(obj);
        }
Exemple #3
0
        public void GetSkillIcon()
        {
            var mock = new Mock <ID3DataProvider>();

            mock.Setup(p => p.FetchData("http://media.blizzard.com/d3/icons/skills/64/whatsoever.png"))
            .Returns <string>(p => new MemoryStream(Encoding.Default.GetBytes(JsonConvert.SerializeObject(new D3Picture()))));
            D3Api.DataProvider = mock.Object;

            var obj = D3Api.GetSkillIcon("whatsoever", "64");

            Assert.IsNotNull(obj);
        }
        public void GetCareerFromBattleTag()
        {
            var mock = new Mock <ID3DataProvider>();

            mock.Setup(p => p.FetchData("http://eu.battle.net/api/d3/profile/tok-2360//index?locale=en"))
            .Returns <string>(p => new MemoryStream(Encoding.Default.GetBytes(JsonConvert.SerializeObject(new Career()))));
            D3Api.DataProvider = mock.Object;

            var obj = D3Api.GetCareerFromBattleTag(battleTag);

            Assert.IsNotNull(obj);
        }
        public void GetItemFromTooltipParams()
        {
            var mock = new Mock <ID3DataProvider>();

            mock.Setup(p => p.FetchData("http://eu.battle.net/api/d3/data/whatsoever?locale=en"))
            .Returns <string>(p => new MemoryStream(Encoding.Default.GetBytes(JsonConvert.SerializeObject(new Item()))));
            D3Api.DataProvider = mock.Object;

            var obj = D3Api.GetItemFromTooltipParams("whatsoever");

            Assert.IsNotNull(obj);
        }
Exemple #6
0
        public void GetItemIconUrl()
        {
            var url = D3Api.GetItemIconUrl("whatsoever", "64");

            Assert.AreEqual("http://media.blizzard.com/d3/icons/items/64/whatsoever.png", url);
        }
Exemple #7
0
        public void GetHeroUrlFromHeroId()
        {
            var url = D3Api.GetHeroUrlFromHeroId(battleTag, "whatsoever");

            Assert.AreEqual("https://eu.api.battle.net/d3/profile/tok-2360/hero/whatsoever", url);
        }
Exemple #8
0
        public void GetCareerUrl()
        {
            var url = D3Api.GetCareerUrl(battleTag);

            Assert.AreEqual("https://eu.api.battle.net/d3/profile/tok-2360/", url);
        }
Exemple #9
0
        public void GetArtisanUrlFromSlug()
        {
            var url = D3Api.GetArtisanUrlFromSlug("whatsoever");

            Assert.AreEqual("https://eu.api.battle.net/d3/data/artisan/whatsoever", url);
        }
Exemple #10
0
        public void GetItemUrlFromTooltipParams()
        {
            var url = D3Api.GetItemUrlFromTooltipParams("whatsoever");

            Assert.AreEqual("https://eu.api.battle.net/d3/data/whatsoever", url);
        }