Esempio n. 1
0
        public async Task UpdateOffer()
        {
            var bolApiCaller = new BolApiCaller(testClientId, testClientSecret, true);
            var fulfilment   = new SmallFulfilment(FulFilmentMethod.FBB);
            var offerUpdate  = new UpdateOffer(fulfilment)
            {
                OnHoldByRetailer = true
            };
            var firstOffer = openOffers.First();
            var result     = await bolApiCaller.Offers.UpdateOffer(firstOffer.OfferId.ToString(), offerUpdate);

            Assert.IsTrue(result.Description == "Update an offer with offerId 4ae7a221-65e7-a333-e620-3f8e1caab5c3.");
        }
Esempio n. 2
0
        public async Task CreateOffer()
        {
            var bolApiCaller = new BolApiCaller(testClientId, testClientSecret, true);
            var condition    = new Condition(ConditionName.GOOD);
            var bundlePrices = new List <BundlePrice>
            {
                new BundlePrice(1, 5.55m)
            };
            var pricing     = new PricingContainer(bundlePrices);
            var stock       = new Stock(5, false);
            var fulfilment  = new SmallFulfilment(FulFilmentMethod.FBB);
            var createOffer = new CreateOffer("9789492493804", condition, pricing, stock, fulfilment)
            {
                Reference = "Test-Api"
            };
            var result = await bolApiCaller.Offers.CreateNewOffer(createOffer);

            Assert.IsTrue(result.Description == "Create an offer with ean 9789492493804.");
        }