public void testListForwardsToDataModel() { WebAPI.IShopActions shop_actions = mock.NewMock <WebAPI.IShopActions>(); Roar.implementation.IDataStore datastore = mock.NewMock <Roar.implementation.IDataStore>(); Roar.ILogger logger = mock.NewMock <Roar.ILogger>(); Roar.implementation.Components.Shop shop = new Roar.implementation.Components.Shop(shop_actions, datastore, logger); IDataModel <Roar.DomainObjects.ShopEntry, Roar.WebObjects.Shop.ListResponse> shop_datamodel = mock.NewMock <IDataModel <Roar.DomainObjects.ShopEntry, Roar.WebObjects.Shop.ListResponse> >(); List <Roar.DomainObjects.ShopEntry> retval = new List <Roar.DomainObjects.ShopEntry>(); retval.Add(new Roar.DomainObjects.ShopEntry()); retval.Add(new Roar.DomainObjects.ShopEntry()); Expect.AtLeast(1).On(datastore) .GetProperty("shop") .Will(Return.Value(shop_datamodel)); Expect.AtLeast(1).On(shop_datamodel) .Method("List") .Will(Return.Value(retval)); IList <Roar.DomainObjects.ShopEntry> l = shop.List(); Assert.AreEqual(2, l.Count); mock.VerifyAllExpectationsHaveBeenMet(); }
new public void Awake() { config = new Roar.implementation.Config(); Logger logger = new Logger(); api = new MockRequestSender(config, this, logger); webAPI = new global::WebAPI(api); Roar.implementation.DataStore data_store = new Roar.implementation.DataStore(webAPI, logger); user = new Roar.implementation.Components.User(webAPI.user, data_store, logger); properties = new Roar.implementation.Components.Properties(data_store); inventory = new Roar.implementation.Components.Inventory(webAPI.items, data_store, logger); shop = new Roar.implementation.Components.Shop(webAPI.shop, data_store, logger); friends = new Roar.implementation.Components.Friends(webAPI.friends, data_store, logger); tasks = new Roar.implementation.Components.Tasks(webAPI.tasks, data_store); urbanAirship = new Roar.implementation.Adapters.UrbanAirship(webAPI); // Apply public settings // TODO: Not sure what this should be now. // Config.game = gameKey; }