/**********************************************************/ public CreateOpt processOptSchedule(VEN2b ven) { OptSchedule optSchedule; lock (m_qOptSchedule) { if (m_qOptSchedule.Count == 0) { return(null); } optSchedule = m_qOptSchedule.Dequeue(); } return(ven.createOptSchedule(RandomHex.instance().generateRandomHex(10), optSchedule)); }
public void P1_2015_VTN_1() { VEN2b ven = new VEN2b(new HttpWebRequestWrapper(false, System.Net.SecurityProtocolType.Tls12), TestProperties.vtnURL, TestProperties.venID, TestProperties.venPassword); OptSchedule optSchedule = new OptSchedule(); optSchedule.addOptSchedule(DateTime.UtcNow.AddDays(1), 0); optSchedule.OptType = OptTypeType.optIn; optSchedule.OptReason = OptReasonEnumeratedType.notParticipating; optSchedule.MarketContext = "http://marketcontext1"; optSchedule.ResourceID = "resource1"; CreateOpt createOpt = ven.createOptSchedule(RandomHex.instance().generateRandomHex(10), optSchedule); Console.Out.WriteLine(createOpt.responseBody); Assert.IsNotNull(createOpt.response); Assert.AreEqual(createOpt.request.optID, createOpt.response.optID); }
/**********************************************************************************/ public void createOptSchedule(OptSchedule optSchedule) { Thread thread = new Thread(delegate() { try { CreateOpt createOpt; lock (m_ven) { createOpt = m_ven.createOptSchedule(RandomHex.instance().generateRandomHex(10), optSchedule); } m_callbacks.processCreateOptSchedule(createOpt); } catch (Exception ex) { m_callbacks.processException(ex); } }); thread.Start(); }