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); }
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); }
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); }
public void GetItemIconUrl() { var url = D3Api.GetItemIconUrl("whatsoever", "64"); Assert.AreEqual("http://media.blizzard.com/d3/icons/items/64/whatsoever.png", url); }
public void GetHeroUrlFromHeroId() { var url = D3Api.GetHeroUrlFromHeroId(battleTag, "whatsoever"); Assert.AreEqual("https://eu.api.battle.net/d3/profile/tok-2360/hero/whatsoever", url); }
public void GetCareerUrl() { var url = D3Api.GetCareerUrl(battleTag); Assert.AreEqual("https://eu.api.battle.net/d3/profile/tok-2360/", url); }
public void GetArtisanUrlFromSlug() { var url = D3Api.GetArtisanUrlFromSlug("whatsoever"); Assert.AreEqual("https://eu.api.battle.net/d3/data/artisan/whatsoever", url); }
public void GetItemUrlFromTooltipParams() { var url = D3Api.GetItemUrlFromTooltipParams("whatsoever"); Assert.AreEqual("https://eu.api.battle.net/d3/data/whatsoever", url); }