Exemple #1
0
        public async Task BoxTest()
        {
            var page = await BrowsingContext.New(Configuration.Default.WithDefaultLoader())
                       .OpenAsync(testAddress);

            var box_element = page.QuerySelectorAll(".card-header")[2].NextElementSibling;
            int itemid      = Convert.ToInt32((await db.Table <Item>().Where(n => n.item_name == "Studio Pass").FirstAsync()).id);

            List <QuestBoxItem> items_values = new List <QuestBoxItem>()
            {
                new QuestBoxItem()
                {
                    box_type = "Main Reward C", questid = 0, itemid = 1880, quantity = 2, appear_chance = 50
                },
                new QuestBoxItem()
                {
                    box_type = "Main Reward C", questid = 0, itemid = 1880, quantity = 1, appear_chance = 40
                },
                new QuestBoxItem()
                {
                    box_type = "Main Reward C", questid = 0, itemid = 1880, quantity = 3, appear_chance = 10
                }
            };

            List <QuestBoxItem> items_data = await questManager.GetBox(box_element, "Main Reward C", 0);

            items_values.ShouldDeepEqual(items_data);
        }