Exemplo n.º 1
0
        public void GetInventoryOnSaleTest()
        {
            foreach (AppId.AppName appId in Enum.GetValues(typeof(AppId.AppName)))
            {
                for (int page = 1; page <= 3; page++)
                {
                    try
                    {
                        InventoryOnSale.GetInventoryOnSale(appId, page, "", 0, 0,
                                                           InventoryOnSale.SortBy.Not,
                                                           InventoryOnSale.SortOrder.Not,
                                                           InventoryOnSale.ThreeChoices.NotImportant,
                                                           InventoryOnSale.ThreeChoices.NotImportant,
                                                           InventoryOnSale.ThreeChoices.NotImportant,
                                                           InventoryOnSale.ResultsPerPage.R480,
                                                           InventoryOnSale.ThreeChoices.NotImportant);
                    }
                    catch (BitSkinsApi.Server.RequestServerException exception)
                    {
                        if (!exception.Message.Contains("(500) Internal Server Error"))
                        {
                            throw exception;
                        }
                    }
                }
            }

            Assert.IsTrue(true);
        }
Exemplo n.º 2
0
        public void GetSpecificItemsOnSaleTest()
        {
            foreach (AppId.AppName appId in Enum.GetValues(typeof(AppId.AppName)))
            {
                List <string> ids = new List <string>();

                List <ItemOnSale> itemsOnSale = new List <ItemOnSale>();
                try
                {
                    itemsOnSale = InventoryOnSale.GetInventoryOnSale(appId, 1, "", 0, 0,
                                                                     InventoryOnSale.SortBy.Not,
                                                                     InventoryOnSale.SortOrder.Not,
                                                                     InventoryOnSale.ThreeChoices.NotImportant,
                                                                     InventoryOnSale.ThreeChoices.NotImportant,
                                                                     InventoryOnSale.ThreeChoices.NotImportant,
                                                                     InventoryOnSale.ResultsPerPage.R480,
                                                                     InventoryOnSale.ThreeChoices.NotImportant);
                }
                catch (BitSkinsApi.Server.RequestServerException exception)
                {
                    if (!exception.Message.Contains("(500) Internal Server Error"))
                    {
                        throw exception;
                    }
                }

                if (itemsOnSale.Count > 0)
                {
                    ids.Add(itemsOnSale[0].ItemId);

                    if (itemsOnSale.Count > 1)
                    {
                        ids.Add(itemsOnSale[itemsOnSale.Count - 1].ItemId);
                    }
                }

                if (ids.Count > 0)
                {
                    SpecificItemsOnSale.GetSpecificItemsOnSale(appId, ids);
                }
            }

            Assert.IsTrue(true);
        }
Exemplo n.º 3
0
        public void BuyItemTest()
        {
            AppId.AppName     app         = AppId.AppName.CounterStrikGlobalOffensive;
            List <ItemOnSale> itemsOnSale = InventoryOnSale.GetInventoryOnSale(app, 1, "", 0, 0.01, InventoryOnSale.SortBy.Price,
                                                                               InventoryOnSale.SortOrder.Asc, InventoryOnSale.ThreeChoices.NotImportant, InventoryOnSale.ThreeChoices.NotImportant,
                                                                               InventoryOnSale.ThreeChoices.NotImportant, InventoryOnSale.ResultsPerPage.R30, InventoryOnSale.ThreeChoices.False);

            if (itemsOnSale.Count > 0)
            {
                ItemOnSale        item        = itemsOnSale[0];
                List <BoughtItem> boughtItems = Purchase.BuyItem(app, new List <string> {
                    item.ItemId
                }, new List <double> {
                    item.Price.Value
                }, false, false);
                string itemId = boughtItems[0].ItemId;
                Assert.AreEqual(item.ItemId, itemId);
            }

            Assert.IsTrue(true);
        }