Пример #1
0
        public void WritePriceAsync(PriceWebsiteDescription description, Action <IWebserviceResult> callback)
        {
            var asyncRequestInfo = new AsyncRequestInfo("WritePriceAsync", callback);

            Webservice.writePriceAsync(description.Valor, description.LastUpdated, description.Bid, description.Ask,
                                       asyncRequestInfo);
        }
Пример #2
0
        public IWebserviceResult WritePrice(PriceWebsiteDescription description)
        {
            var info = new RequestInfo(string.Format("WritePrice {0}", description));

            object[] writePrice = Webservice.writePrice(description.Valor, description.LastUpdated, description.Bid,
                                                        description.Ask);
            return(new WebserviceResult(info, writePrice));
        }
Пример #3
0
        public static PriceWebsiteDescription GetPriceWebsiteDescription()
        {
            PriceWebsiteDescription price;

            using (var db = new StruktoWebsiteEntities())
            {
                price = new PriceWebsiteDescription(db.GetPriceWebsiteData(Settings.Default.TestProductValor).Single());
            }
            return(price);
        }
        public void WritePriceOnDisconnectedServiceTest()
        {
            var wrapper = new CatWebserviceWrapper(Service);
            PriceWebsiteDescription price = TestHelper.GetPriceWebsiteDescription();

            Assert.AreEqual(WebserviceWrapperState.Disconnected, wrapper.WebserviceState);

            IWebserviceResult webserviceResult = wrapper.WritePrice(price);

            Assert.IsTrue(webserviceResult.HasErrors);
            Assert.IsNotNull(webserviceResult.RequestInfo);
        }
        public void WritePriceForOnlineProductTest()
        {
            var wrapper = new CatWebserviceWrapper(Service);
            PriceWebsiteDescription price = TestHelper.GetPriceWebsiteDescription();

            wrapper.Connect();

            IWebserviceResult webserviceResult = wrapper.WritePrice(price);

            Assert.IsFalse(webserviceResult.HasErrors);
            Assert.IsNotNull(webserviceResult.RequestInfo);
        }
        public void DeleteAllPricesForValor()
        {
            PriceWebsiteDescription price = TestHelper.GetPriceWebsiteDescription();

            var wrapper = new CatWebserviceWrapper(Service);

            wrapper.Connect();

            IWebserviceResult webserviceResult = wrapper.WritePrice(price);

            Assert.IsFalse(webserviceResult.HasErrors, webserviceResult.ServiceMessage);
            wrapper.DeleteAllPrices(price.Valor);
        }
 public void WritePriceAsync(PriceWebsiteDescription description, Action <IWebserviceResult> callback)
 {
     throw new NotImplementedException();
 }
 public IWebserviceResult WritePrice(PriceWebsiteDescription description)
 {
     throw new NotImplementedException();
 }