Пример #1
0
        public void MaxListPriceNegativeArgumentException()
        {
            var          sc           = new BooliNET.ExtendedSearchConditionList();
            TestDelegate throwingCode = () => sc.MaxListPrice = -4;

            Assert.Throws <ArgumentException>(throwingCode);
        }
Пример #2
0
        // Listings examples
        public void RunSimpleListingsExample()
        {
            var booli = new BooliNET.Booli(CallerId, Key);

            var sc  = new BooliNET.BooliSearchCondition();
            var esc = new BooliNET.ExtendedSearchConditionList(); //Extended search condition for lists, only used as argument here

            sc.Q     = "Nacka";
            sc.Limit = 5;

            var result = booli.GetResultList(sc, esc);

            Console.WriteLine("Simple Listings Example\n");
            Console.WriteLine("Result:\n");
            Console.WriteLine("Count: " + result.count.ToString());
            Console.WriteLine("Total count: " + result.totalCount.ToString());

            foreach (Listing listing in result.listings)
            {
                Console.WriteLine("\n===========");
                Console.WriteLine("BooliId: " + listing.booliId.ToString());
                Console.WriteLine("List price: " + listing.listPrice.ToString());
                Console.WriteLine("Living Area: " + listing.livingArea.ToString());
                Console.WriteLine("City: " + listing.location.address.city.ToString());
                Console.WriteLine("Street Adress: " + listing.location.address.streetAddress.ToString());
            }
        }
Пример #3
0
        public void SetPriceDecrease()
        {
            var sc = new BooliNET.ExtendedSearchConditionList();

            sc.PriceDecrese = true;
            Assert.That(sc.PriceDecrese == true);
        }
Пример #4
0
        public void SetMaxListPrice()
        {
            var sc = new BooliNET.ExtendedSearchConditionList();

            sc.MaxListPrice = 30000;
            Assert.That(sc.MaxListPrice == 30000);
        }
Пример #5
0
        public void CreateUrl()
        {
            var sc = new BooliNET.ExtendedSearchConditionList();

            sc.MinListPrice = 20000;
            sc.MaxListPrice = 30000;
            sc.PriceDecrese = true;

            Assert.That(sc.CreateUrl() == "&minListPrice=20000&maxListPrice=30000&priceDecrease=1");
        }
Пример #6
0
        public void AreaIdListingsExample()
        {
            var booli = new BooliNET.Booli(CallerId, Key);

            var sc = new BooliNET.BooliSearchCondition();
            var esc = new BooliNET.ExtendedSearchConditionList();
            sc.AreaId = "76,16";
            sc.MinRooms = 3;
            sc.Limit = 5;

            var result = booli.GetResultList(sc, esc);
            Console.WriteLine("Area Id Example!\n");
            Console.WriteLine(result.ToString());
        }
Пример #7
0
        public void BboxListingsExample()
        {
            var booli = new BooliNET.Booli(CallerId, Key);

            var sc = new BooliNET.BooliSearchCondition();
            var esc = new BooliNET.ExtendedSearchConditionList();
            sc.Bbox = "57.69330,11.96522,57.73896,12.03320";
            esc.MinListPrice = 1000000;
            esc.MaxListPrice = 3000000;
            sc.Limit = 5;

            var result = booli.GetResultList(sc, esc);
            Console.WriteLine("Bbox Example!\n");
            Console.WriteLine(result.ToString());
        }
Пример #8
0
        public void CenterDimListingsExample()
        {
            var booli = new BooliNET.Booli(CallerId, Key);

            var sc = new BooliNET.BooliSearchCondition();
            var esc = new BooliNET.ExtendedSearchConditionList();
            sc.Center = "59.34674,18.0603";
            sc.Dim = "15000,1000";
            sc.MinPlotArea = 100;
            sc.MaxPlotArea = 5000;
            sc.Limit = 5;

            var result = booli.GetResultList(sc, esc);
            Console.WriteLine("Center and Dim Example!\n");
            Console.WriteLine(result.ToString());
        }
Пример #9
0
        public void AreaIdListingsExample()
        {
            var booli = new BooliNET.Booli(CallerId, Key);

            var sc  = new BooliNET.BooliSearchCondition();
            var esc = new BooliNET.ExtendedSearchConditionList();

            sc.AreaId   = "76,16";
            sc.MinRooms = 3;
            sc.Limit    = 5;

            var result = booli.GetResultList(sc, esc);

            Console.WriteLine("Area Id Example!\n");
            Console.WriteLine(result.ToString());
        }
Пример #10
0
        public void BboxListingsExample()
        {
            var booli = new BooliNET.Booli(CallerId, Key);

            var sc  = new BooliNET.BooliSearchCondition();
            var esc = new BooliNET.ExtendedSearchConditionList();

            sc.Bbox          = "57.69330,11.96522,57.73896,12.03320";
            esc.MinListPrice = 1000000;
            esc.MaxListPrice = 3000000;
            sc.Limit         = 5;

            var result = booli.GetResultList(sc, esc);

            Console.WriteLine("Bbox Example!\n");
            Console.WriteLine(result.ToString());
        }
Пример #11
0
        public void CenterDimListingsExample()
        {
            var booli = new BooliNET.Booli(CallerId, Key);

            var sc  = new BooliNET.BooliSearchCondition();
            var esc = new BooliNET.ExtendedSearchConditionList();

            sc.Center      = "59.34674,18.0603";
            sc.Dim         = "15000,1000";
            sc.MinPlotArea = 100;
            sc.MaxPlotArea = 5000;
            sc.Limit       = 5;

            var result = booli.GetResultList(sc, esc);

            Console.WriteLine("Center and Dim Example!\n");
            Console.WriteLine(result.ToString());
        }
Пример #12
0
        // Listings examples
        public void RunSimpleListingsExample()
        {
            var booli = new BooliNET.Booli(CallerId, Key);

            var sc = new BooliNET.BooliSearchCondition();
            var esc = new BooliNET.ExtendedSearchConditionList(); //Extended search condition for lists, only used as argument here
            sc.Q = "Nacka";
            sc.Limit = 5;

            var result = booli.GetResultList(sc, esc);
            Console.WriteLine("Simple Listings Example\n");
            Console.WriteLine("Result:\n");
            Console.WriteLine("Count: " + result.count.ToString());
            Console.WriteLine("Total count: " + result.totalCount.ToString());

            foreach (Listing listing in result.listings)
            {
                Console.WriteLine("\n===========");
                Console.WriteLine("BooliId: " + listing.booliId.ToString());
                Console.WriteLine("List price: " + listing.listPrice.ToString());
                Console.WriteLine("Living Area: " + listing.livingArea.ToString());
                Console.WriteLine("City: " + listing.location.address.city.ToString());
                Console.WriteLine("Street Adress: " + listing.location.address.streetAddress.ToString());
            }
        }
Пример #13
0
 public void SetPriceDecrease()
 {
     var sc = new BooliNET.ExtendedSearchConditionList();
     sc.PriceDecrese = true;
     Assert.That(sc.PriceDecrese == true);
 }
Пример #14
0
 public void SetMinListPrice()
 {
     var sc = new BooliNET.ExtendedSearchConditionList();
     sc.MinListPrice = 20000;
     Assert.That(sc.MinListPrice == 20000);
 }
Пример #15
0
        public void SearchConditionClear()
        {
            var sc = new BooliNET.ExtendedSearchConditionList();
            sc.MinListPrice = 20000;
            sc.MaxListPrice = 30000;
            sc.PriceDecrese = true;
            sc.CreateUrl();
            sc.ClearSearch();

            sc.MinListPrice = 12000;
            sc.MaxListPrice = 40000;

            Assert.That(sc.CreateUrl() == "&minListPrice=12000&maxListPrice=40000");
        }
Пример #16
0
 public void MinListPriceNegativeArgumentException()
 {
     var sc = new BooliNET.ExtendedSearchConditionList();
     TestDelegate throwingCode = () => sc.MinListPrice = -3;
     Assert.Throws<ArgumentException>(throwingCode);
 }