Пример #1
0
 public void Create_SiteNotFound()
 {
     Assert.ThrowsException <System.Net.WebException>(() =>
     {
         Xyz.Create("http://poedb1.tw/xyz.php?name=%E5%AD%B8%E5%AF%8C%E4%B9%8B%E7%AD%86&league=Warbands&status=1&boi=9&boc_min=1&boc_max=3");
     });
 }
Пример #2
0
        public void Create_FoundNormalItem()
        {
            var xyz = Xyz.Create("http://poedb.tw/xyz.php?id=3e6aec65184154b5cc00179669de1882");

            Assert.IsTrue(xyz.IsFoundItems);

            Assert.AreEqual("女神祭品", xyz.CurrentItemName);
        }
Пример #3
0
        public void Create_FoundUniqueItem()
        {
            var xyz = Xyz.Create("http://poedb.tw/xyz.php?name=%E5%AD%B8%E5%AF%8C%E4%B9%8B%E7%AD%86&league=Warbands&status=1&boi=9&boc_min=1&boc_max=3");

            Assert.IsTrue(xyz.IsFoundItems);

            Assert.AreEqual("學富之筆 粗紋法杖", xyz.Items.First().Name);
            Assert.AreEqual("崇高石", xyz.Items.First().PriceUnit);
        }
Пример #4
0
        public void ReloadByDiffUrl_NotFound()
        {
            var xyz = Xyz.Create("http://poedb.tw/xyz.php?name=%E5%AD%B8%E5%AF%8C%E4%B9%8B%E7%AD%86&league=Warbands&status=1&boi=9&boc_min=1&boc_max=3");

            Assert.IsTrue(xyz.IsFoundItems);

            xyz.Reload("http://poedb.tw/xyz.php?name=%E7%84%A1%E7%9B%A1%E4%B9%8B%E8%A1%A3&league=Warbands&status=1&boi=1&boc_min=1&boc_max=1");
            Assert.IsFalse(xyz.IsFoundItems);
            Assert.AreEqual("無盡之衣", xyz.ItemName);
        }
Пример #5
0
        public void Reload_SiteNotFound()
        {
            var xyz = Xyz.Create("http://poedb.tw/xyz.php?name=%E5%AD%B8%E5%AF%8C%E4%B9%8B%E7%AD%86&league=Warbands&status=1&boi=9&boc_min=1&boc_max=3");

            Assert.IsTrue(xyz.IsFoundItems);

            Assert.ThrowsException <System.Net.WebException>(() =>
            {
                xyz.Reload("http://poedb1.tw/xyz.php?name=%E5%AD%B8%E5%AF%8C%E4%B9%8B%E7%AD%86&league=Warbands&status=1&boi=9&boc_min=1&boc_max=3");
            });
        }
Пример #6
0
        public void SetBlacklist()
        {
            var xyz = Xyz.Create("http://poedb.tw/xyz.php?name=%E5%AD%B8%E5%AF%8C%E4%B9%8B%E7%AD%86&league=Warbands&status=1&boi=9&boc_min=1&boc_max=3");

            Assert.IsTrue(xyz.IsFoundItems);
            Assert.IsTrue(xyz.Items.Count > 0);

            var blacklists = xyz.Items.Select(item => item.Account).ToList();

            xyz.SetBlacklist(blacklists);
            Assert.AreEqual(0, xyz.Items.Count);
        }
Пример #7
0
        public void Create_NotFoundButHasQueryConditions()
        {
            var xyz = Xyz.Create("http://poedb.tw/xyz.php?name=%E7%84%A1%E7%9B%A1%E4%B9%8B%E8%A1%A3&league=Warbands&status=1&boi=1&boc_min=1&boc_max=1");

            Assert.IsFalse(xyz.IsFoundItems);
            Assert.AreEqual("無盡之衣", xyz.ItemName);

            var display = xyz as IGridViewDisplay;

            Assert.AreEqual("無盡之衣", display.ItemName);
            Assert.AreEqual("1 ~ 1 卡蘭德的魔鏡", display.QueryPrice);

            var query = xyz.Query;

            Assert.AreEqual("無盡之衣", query.Name);
            Assert.AreEqual(1, query.MaxPrice);
            Assert.AreEqual(Loader.Data.CurrencyType.MirrorOfKalandra, query.Currency);
        }
Пример #8
0
        public void Reload()
        {
            var xyz = Xyz.Create("http://poedb.tw/xyz.php?name=%E5%AD%B8%E5%AF%8C%E4%B9%8B%E7%AD%86&league=Warbands&status=1&boi=9&boc_min=1&boc_max=3");

            Assert.IsTrue(xyz.IsFoundItems);

            var firstItemCount = ((IGridViewDisplay)xyz).ItemCount;

            xyz.Reload();

            Assert.IsTrue(xyz.IsFoundItems);

            Assert.AreEqual("學富之筆 粗紋法杖", xyz.Items.First().Name);
            Assert.AreEqual("崇高石", xyz.Items.First().PriceUnit);

            var secondItemCount = ((IGridViewDisplay)xyz).ItemCount;

            Assert.AreEqual(firstItemCount, secondItemCount);
        }
Пример #9
0
        public void Create_NotFound()
        {
            var xyz = Xyz.Create("http://poedb.tw/xyz.php?name=%E5%AD%B8%E5%AF%8C%E4%B9%8B%E7%AD%86&league=Warbands&status=1&boi=9&boc_min=1&boc_max=0");

            Assert.IsFalse(xyz.IsFoundItems);
        }
Пример #10
0
        public void Create_FormatInvalid()
        {
            var xyz = Xyz.Create("http://poedb.tw/");

            Assert.IsFalse(xyz.IsFoundItems);
        }
Пример #11
0
 public void Create_UrlEmpty()
 {
     Assert.IsNull(Xyz.Create(""));
 }