public Price GetPrice(IRateExchange exchange, IUserContext userContext) { User currentUser = userContext.GetCurrentUser(); Currency currency = userContext.GetSelectedCurrency(currentUser); int priceInSelectedCurrency = exchange.Convert(GetPrice(), currency); var price = new Price{Currency = currency, Value = priceInSelectedCurrency}; return price; }
public OrderProcessorServiceLocator(IUserContext userContext, IRateExchange rateExchange, IAccountsReceivable accountsReceivable) { _userContext = userContext; _rateExchange = rateExchange; _accountsReceivable = accountsReceivable; InstanceId = Guid.NewGuid(); }
public OrderProcessorContainer(IWindsorContainer container, IUserContext userContext, IRateExchange rateExchange, IAccountsReceivable accountsReceivable) { _userContext = userContext; _rateExchange = rateExchange; _accountsReceivable = accountsReceivable; _container = container; InstanceId = Guid.NewGuid(); }
public OrderProcessor(IOrderValidator validator, IAccountsReceivable receivable, IRateExchange exchange, IUserContext userContext) { _validator = validator; _receivable = receivable; _exchange = exchange; _userContext = userContext; }
public Price GetPrice(IRateExchange exchange, IUserContext userContext) { User currentUser = userContext.GetCurrentUser(); Currency currency = userContext.GetSelectedCurrency(currentUser); int priceInSelectedCurrency = exchange.Convert(GetPrice(), currency); var price = new Price { Currency = currency, Value = priceInSelectedCurrency }; return(price); }
public OrderProcessor(IOrderValidator validator, IAccountsReceivable receivable, IRateExchange exchange, IUserContext userContext, ILogger logger, IOrderShipper orderShipper, MessageDispatcher messageDispatcher) { Thread.Sleep(TimeSpan.FromMilliseconds(1500)); InstanceId = Guid.NewGuid(); _validator = validator; _receivable = receivable; _exchange = exchange; _userContext = userContext; _logger = logger; _orderShipper = orderShipper; _messageDispatcher = messageDispatcher; }
public OrderCollector(IAccountsReceivable receivable, IRateExchange exchange, IUserContext userContext) { _receivable = receivable; _exchange = exchange; _userContext = userContext; }