// TODO: modifiers is returning null - does this not get translated from the xml? public void testGetShopItem() { //returns null on no data from server Assert.IsNull(shop.GetShopItem("shop_item_ikey_1")); mockFetch(shopList, null); //returns Hashtable of property if exists Roar.DomainObjects.ShopEntry shopItem = shop.GetShopItem("shop_item_ikey_1"); IList <Roar.DomainObjects.Cost> costs = shopItem.costs; Roar.DomainObjects.Costs.Stat costA = costs[0] as Roar.DomainObjects.Costs.Stat; Roar.DomainObjects.Costs.Stat costB = costs[1] as Roar.DomainObjects.Costs.Stat; StringAssert.IsMatch("cash", costA.ikey); StringAssert.IsMatch("premium_currency", costB.ikey); Assert.AreEqual(false, costA.ok); Assert.AreEqual(true, costB.ok); IList <Roar.DomainObjects.Modifier> modifiers = shopItem.modifiers; Roar.DomainObjects.Modifiers.GrantItem modifier = modifiers[0] as Roar.DomainObjects.Modifiers.GrantItem; StringAssert.IsMatch("item_ikey_1", modifier.ikey); //returns null on property not existing Assert.IsNull(shop.GetShopItem("doesnotexist")); }
public override string OnModifierGrantItem(Roar.DomainObjects.Modifiers.GrantItem mod) { return("Grants Item: " + mod.ikey); }
public abstract T OnModifierGrantItem(Roar.DomainObjects.Modifiers.GrantItem mod);