public PrepaidVoucherService(IComponentInitContext initContext) { this.context = initContext; Int32.TryParse(context.Config["endpoint_port"], out port); wcfEndpoint = CreateWcfEndpoint(context.Config["endpoint_name"], port); }
public static T GetService <T>(IComponentInitContext context) { if (context != null && context.Services != null && context.Services.Asm != null) { return(context.Services.Asm.GetServiceProxyWithDecorator <T>()); } return(default(T)); }
public ConfigureSetting(IComponentInitContext context) { VmsWSUrl = context.Config[VMS_WS_URL]; VmsUserCode = context.Config[VMS_WS_USERCODE]; VmsUserPass = context.Config[VMS_WS_PASS]; int.TryParse(context.Config[PREPAID_VOUCHER_LEDGER_ACCOUNT_ID], out PrepaidVoucherLedgerAccountId); int.TryParse(context.Config[PREPAID_VOUCHER_CURRENCY_ID], out PrepaidVoucherCurrencyId); }
public void Initialize() { _mockery = new Mockery(); _context = _mockery.NewMock <IComponentInitContext>(); IPropertySet config = PropertySet.Create(); config["endpoint_name"] = "PrepaidVoucherInBound"; config["endpoint_port"] = "8083"; Expect.AtLeastOnce.On(_context).GetProperty("Config").Will(Return.Value(config)); }
public PP_01_ConsumeVoucher(IComponentInitContext context, ConsumeVoucherData data) { try { _context = context; _setting = new ConfigureSetting(context); _data = data; } catch (Exception ex) { throw new IntegrationException("Error while initializing componet configuration", ex); } }
public PrepaidVoucherListener(IComponentInitContext initContext) { try { _service = new PrepaidVoucherService(initContext); _service.Start(); } catch (Exception ex) { if (_service != null) { _service.ForceStop(); } Diagnostics.Error(ex.Message); } }
// This call is here so that our unit tests can mock up the creation of the voucher command. protected virtual PP_01_ConsumeVoucher CreateVoucherCommand(IComponentInitContext context, ConsumeVoucherData data) { return(new PP_01_ConsumeVoucher(context, data)); }
public void Clear() { _mockery = null; _context = null; }
public PP_01_AlreadConsumed_Mock(IComponentInitContext context, ConsumeVoucherData data) : base(context, data) { m_mock = new Mockery(); mock_data = data; }
protected override PP_01_ConsumeVoucher CreateVoucherCommand(IComponentInitContext context, ConsumeVoucherData data) { throw new Exception(exceptionText); }
public PrepaidVoucherServiceExceptionMock(IComponentInitContext initContext) : base(initContext) { }
protected override PP_01_ConsumeVoucher CreateVoucherCommand(IComponentInitContext context, ConsumeVoucherData data) { pp_01 = new PP_01_Mock(context, data); return(pp_01); }
public PrepaidVoucherServiceMock(IComponentInitContext initContext) : base(initContext) { m_mock = new Mockery(); }
public PP_01_Mock(IComponentInitContext context, ConsumeVoucherData data) : base(context, data) { m_mock = new Mockery(); }