private CustomersService() { _daoManager = ServiceConfig.GetInstance().DaoManager; _customerInfoDao = _daoManager.GetDao(typeof(ICustomerInfoDao)) as ICustomerInfoDao; _customerOrderDao = _daoManager.GetDao(typeof(ICustomerOrderDao)) as ICustomerOrderDao; _orderDao = _daoManager.GetDao(typeof(IOrderDao)) as IOrderDao; }
public CreateOrderService(ICommandBus commandBus, IAccountDao accountDao, IServerSettings serverSettings, ReferenceDataService referenceDataService, IIBSServiceProvider ibsServiceProvider, IRuleCalculator ruleCalculator, IAccountChargeDao accountChargeDao, ICreditCardDao creditCardDao, IOrderDao orderDao, IPromotionDao promotionDao, IEventSourcedRepository <Promotion> promoRepository, ITaxiHailNetworkServiceClient taxiHailNetworkServiceClient, IPaymentService paymentService, IPayPalServiceFactory payPalServiceFactory, IOrderPaymentDao orderPaymentDao, IFeesDao feesDao, ILogger logger, IIbsCreateOrderService ibsCreateOrderService) : base(serverSettings, commandBus, accountChargeDao, paymentService, creditCardDao, ibsServiceProvider, promotionDao, promoRepository, orderPaymentDao, accountDao, payPalServiceFactory, logger, taxiHailNetworkServiceClient, ruleCalculator, feesDao, referenceDataService, orderDao) { _commandBus = commandBus; _accountDao = accountDao; _referenceDataService = referenceDataService; _serverSettings = serverSettings; _orderDao = orderDao; _taxiHailNetworkServiceClient = taxiHailNetworkServiceClient; _logger = logger; _ibsCreateOrderService = ibsCreateOrderService; _resources = new Resources.Resources(_serverSettings); _taxiHailNetworkHelper = new TaxiHailNetworkHelper(_serverSettings, _taxiHailNetworkServiceClient, _commandBus, _logger); }
public AccountManagementController(ICacheClient cache, IServerSettings serverSettings, IAccountDao accountDao, IAccountNoteService accountNoteService, ICreditCardDao creditCardDao, ICommandBus commandBus, IOrderDao orderDao, IPromotionDao promoDao, IPaymentService paymentService, INotificationService notificationService, BookingSettingsService bookingSettingsService, ConfirmAccountService confirmAccountService, ExportDataService exportDataService) : base(cache, serverSettings) { _accountDao = accountDao; _accountNoteService = accountNoteService; _creditCardDao = creditCardDao; _bookingSettingsService = bookingSettingsService; _commandBus = commandBus; _serverSettings = serverSettings; _orderDao = orderDao; _promoDao = promoDao; _confirmAccountService = confirmAccountService; _exportDataService = exportDataService; _paymentService = paymentService; _notificationService = notificationService; _resources = new Resources(serverSettings); }
private CustomersService() { _daoManager = ServiceConfig.GetInstance().DaoManager; _customerInfoDao = _daoManager.GetDao(typeof(ICustomerInfoDao)) as ICustomerInfoDao; _customerOrderDao = _daoManager.GetDao(typeof(ICustomerOrderDao)) as ICustomerOrderDao; _orderDao = _daoManager.GetDao(typeof(IOrderDao)) as IOrderDao; }
public OrderPairingService(IOrderDao orderDao, ICommandBus commandBus, IServerSettings serverSettings, IPaymentService paymentService) { _orderDao = orderDao; _commandBus = commandBus; _serverSettings = serverSettings; _paymentService = paymentService; }
public AccountController() { loginsDb = LoginsTableConnection.Instance; datesDb = DatesTableConnection.Instance; ordersDb = OrdersTableConnection.Instance; playsDb = PlaysTableConnection.Instance; }
public given_controller() { this.bus = Mock.Of <ICommandBus>(); this.conferenceDao = Mock.Of <IConferenceDao>(x => x.GetConferenceAlias(conferenceAlias.Code) == conferenceAlias); this.orderDao = Mock.Of <IOrderDao>(); this.routes = new RouteCollection(); this.routeData = new RouteData(); this.routeData.Values.Add("conferenceCode", conferenceAlias.Code); var requestMock = new Mock <HttpRequestBase>(MockBehavior.Strict); requestMock.SetupGet(x => x.ApplicationPath).Returns("/"); requestMock.SetupGet(x => x.Url).Returns(new Uri("http://localhost/request", UriKind.Absolute)); requestMock.SetupGet(x => x.ServerVariables).Returns(new NameValueCollection()); var responseMock = new Mock <HttpResponseBase>(MockBehavior.Strict); responseMock.Setup(x => x.ApplyAppPathModifier(It.IsAny <string>())).Returns <string>(s => s); var context = Mock.Of <HttpContextBase>(c => c.Request == requestMock.Object && c.Response == responseMock.Object); this.sut = new RegistrationController(this.bus, this.orderDao, this.conferenceDao); this.sut.ConferenceAlias = conferenceAlias; this.sut.ConferenceCode = conferenceAlias.Code; this.sut.ControllerContext = new ControllerContext(context, this.routeData, this.sut); this.sut.Url = new UrlHelper(new RequestContext(context, this.routeData), this.routes); }
public SendReceiptService( ICommandBus commandBus, IIBSServiceProvider ibsServiceProvider, IOrderDao orderDao, IOrderPaymentDao orderPaymentDao, ICreditCardDao creditCardDao, IAccountDao accountDao, IPromotionDao promotionDao, IReportDao reportDao, IServerSettings serverSettings, IGeocoding geocoding, ILogger logger) { _serverSettings = serverSettings; _logger = logger; _ibsServiceProvider = ibsServiceProvider; _orderDao = orderDao; _orderPaymentDao = orderPaymentDao; _accountDao = accountDao; _promotionDao = promotionDao; _reportDao = reportDao; _creditCardDao = creditCardDao; _geocoding = geocoding; _commandBus = commandBus; }
public CreditCardService(ICreditCardDao dao, ICommandBus commandBus, IOrderDao orderDao, IServerSettings serverSettings) { _orderDao = orderDao; _serverSettings = serverSettings; _dao = dao; _commandBus = commandBus; }
public given_controller() { this.bus = Mock.Of<ICommandBus>(); this.conferenceDao = Mock.Of<IConferenceDao>(x => x.GetConferenceAlias(conferenceAlias.Code) == conferenceAlias); this.orderDao = Mock.Of<IOrderDao>(); this.routes = new RouteCollection(); this.routeData = new RouteData(); this.routeData.Values.Add("conferenceCode", conferenceAlias.Code); var requestMock = new Mock<HttpRequestBase>(MockBehavior.Strict); requestMock.SetupGet(x => x.ApplicationPath).Returns("/"); requestMock.SetupGet(x => x.Url).Returns(new Uri("http://localhost/request", UriKind.Absolute)); requestMock.SetupGet(x => x.ServerVariables).Returns(new NameValueCollection()); var responseMock = new Mock<HttpResponseBase>(MockBehavior.Strict); responseMock.Setup(x => x.ApplyAppPathModifier(It.IsAny<string>())).Returns<string>(s => s); var context = Mock.Of<HttpContextBase>(c => c.Request == requestMock.Object && c.Response == responseMock.Object); this.sut = new RegistrationController(this.bus, this.orderDao, this.conferenceDao); this.sut.ConferenceAlias = conferenceAlias; this.sut.ConferenceCode = conferenceAlias.Code; this.sut.ControllerContext = new ControllerContext(context, this.routeData, this.sut); this.sut.Url = new UrlHelper(new RequestContext(context, this.routeData), this.routes); }
public given_created_seat_assignments() { var conferenceDao = new Mock <IConferenceDao>(); conferenceDao.Setup(x => x.GetSeatTypeNames(It.IsAny <IEnumerable <Guid> >())) .Returns(seatTypes); var blobs = new MemoryBlobStorage(); this.dao = new OrderDao(() => new ConferenceRegistrationDbContext(dbName), blobs, new JsonTextSerializer()); this.sut = new SeatAssignmentsViewModelGenerator(conferenceDao.Object, blobs, new JsonTextSerializer()); this.sut.Handle(new SeatAssignmentsCreated { SourceId = assignmentsId, OrderId = orderId, Seats = new[] { new SeatAssignmentsCreated.SeatAssignmentInfo { Position = 0, SeatType = seatTypes[0].Id }, new SeatAssignmentsCreated.SeatAssignmentInfo { Position = 1, SeatType = seatTypes[1].Id }, } }); }
public void SetUp() { _salesOrderOne = new SalesOrder { Id = 1 }; var salesOrderTwo = new SalesOrder { Id = 2 }; _salesOrderThree = new SalesOrder { Id = 3 }; var salesOrders = new List <SalesOrder> { salesOrderTwo, _salesOrderOne, _salesOrderThree }; _dalFacade = Substitute.For <IDalFacade>(); _dalFacade.UnitOfWork.SalesOrderRepository .When(x => x.Get(null, Arg.Any <Func <IQueryable <SalesOrder>, IOrderedQueryable <SalesOrder> > >())) .Do(x => _orderedSalesOrders = x.Arg <Func <IQueryable <SalesOrder>, IOrderedQueryable <SalesOrder> > >().Invoke(salesOrders.AsQueryable()).ToList()); _dalFacade.UnitOfWork.SalesOrderRepository .Get(null, Arg.Any <Func <IQueryable <SalesOrder>, IOrderedQueryable <SalesOrder> > >()) .Returns(salesOrders); _uut = new OrderDao(_dalFacade); }
public BillingService(DaoManager daoManager) { _daoManager = daoManager; _itemDao = _daoManager[typeof(IItemDao)] as IItemDao; _orderDao = _daoManager[typeof(IOrderDao)] as IOrderDao; _sequenceDao = _daoManager[typeof(ISequenceDao)] as ISequenceDao; }
private DailyBalanceService() { _daoManager = ServiceConfig.GetInstance().DaoManager; _orderDao = _daoManager.GetDao(typeof(IOrderDao)) as IOrderDao; _dailyStatementDao = _daoManager.GetDao(typeof(IDailyStatementDao)) as IDailyStatementDao; _dailyTurnoverDao = _daoManager.GetDao(typeof(IDailyTurnoverDao)) as IDailyTurnoverDao; }
public AddressHistoryService(IAddressDao dao, ICommandBus commandBus, IAccountDao accountDao, IOrderDao orderDao) { _dao = dao; _commandBus = commandBus; _accountDao = accountDao; _orderDao = orderDao; }
/// <summary> /// Gets all need information in ViewBag /// </summary> /// <param name="id">Date id</param> private void getViewBagForOrderPage(int id) { ViewBag.DateId = id; IOrderDao orders = OrdersTableConnection.Instance; IDateDao datesDb = DatesTableConnection.Instance; DatePlay currentDate = datesDb.GetDateById(id); IPlayDao playsDb = PlaysTableConnection.Instance; Play play = playsDb.GetPlayById(currentDate.PlayId); ViewBag.Play = play; IGenreDao genresDb = GenresTableConnection.Instance; ViewBag.Genre = genresDb.GetGenreById(play.GenreId); IAuthorDao authorsDb = AuthorsTableConnection.Instance; ViewBag.Author = authorsDb.GetAuthorById(play.AuthorId); ViewBag.Dates = datesDb.GetDatesByIdPlay(play.Id).OrderBy(x => x.Date).ToList(); ViewBag.TotalCountBalconySeats = TheaterInformation.TotalCountBalconySeats; ViewBag.PriceBalconySeats = TheaterInformation.PriceBalcony; ViewBag.FreeBalconySeats = (TheaterInformation.TotalCountBalconySeats - orders.GetCountBusySeetsByDateIdAndCategory(id, 0)); ViewBag.TotalCountParterreSeats = TheaterInformation.TotalCountParterreSeats; ViewBag.PriceParterreSeats = TheaterInformation.PriceParterre; ViewBag.FreeParterreSeats = (TheaterInformation.TotalCountParterreSeats - orders.GetCountBusySeetsByDateIdAndCategory(id, 1)); }
public void Setup() { this._dbName = this.GetType().Name + "-" + Guid.NewGuid(); using (var context = new ConferenceRegistrationDbContext(this._dbName)) { if (context.Database.Exists()) { context.Database.Delete(); } context.Database.Create(); } var blobStorage = new MemoryBlobStorage(); this._sut = new DraftOrderViewModelGenerator(() => new ConferenceRegistrationDbContext(_dbName)); this._dao = new OrderDao(() => new ConferenceRegistrationDbContext(_dbName), blobStorage, new JsonTextSerializer()); System.Diagnostics.Trace.Listeners.Clear(); this._orderPlacedEvent = new OrderPlaced { SourceId = Guid.NewGuid(), ConferenceId = Guid.NewGuid(), AccessCode = "asdf", Seats = new[] { new SeatQuantity(Guid.NewGuid(), 5) }, Version = 1 }; _sut.Handle(_orderPlacedEvent); }
public ActionResult DeleteOrder(int orderId) { IOrderDao orders = OrdersTableConnection.Instance; orders.DeleteOrderById(orderId); return(RedirectToAction("Cart", "Account")); }
public given_a_read_model_generator() { var blobStorage = new MemoryBlobStorage(); sut = new DraftOrderViewModelGenerator(() => new ConferenceRegistrationDbContext(dbName)); dao = new OrderDao(() => new ConferenceRegistrationDbContext(dbName), blobStorage, new JsonTextSerializer()); }
private DailyBalanceService() { _daoManager = ServiceConfig.GetInstance().DaoManager; _orderDao = _daoManager.GetDao(typeof(IOrderDao)) as IOrderDao; _dailyStatementDao = _daoManager.GetDao(typeof(IDailyStatementDao)) as IDailyStatementDao; _dailyTurnoverDao = _daoManager.GetDao(typeof(IDailyTurnoverDao)) as IDailyTurnoverDao; }
public PairingService(ICommandBus commandBus, IIbsOrderService ibs, IOrderDao orderDao, IServerSettings serverSettings) { _commandBus = commandBus; _ibs = ibs; _orderDao = orderDao; _resources = new Resources.Resources(serverSettings); }
public OrderCancellationManager(IOrderDao orderDao, IIbsCreateOrderService ibsCreateOrderService, ILogger logger) { _orderDao = orderDao; _ibsCreateOrderService = ibsCreateOrderService; _logger = logger; }
public OrderLogic(IOrderDao iOrderDao, ILoggerDao iLoggerDao) { NullCheck(iOrderDao); NullCheck(iLoggerDao); orderDao = iOrderDao; loggerDao = iLoggerDao; }
public void SetUpBl(string db) { _krapfenDao = new KrapfenDao(db); _orderDao = new OrderDao(db); _eventDao = new EventDao(db); _sellingDao = new SellingDao(db); _userDao = new UserDao(db); }
private static void BuildDAOFactory() { categoryDao = factory.CategoryDao; productDao = factory.ProductDao; memberDao = factory.MemberDao; orderDao = factory.OrderDao; orderDetailDao = factory.OrderDetailDao; }
private OrderService() { _daoManager = ServiceConfig.GetInstance().DaoManager; _orderDao = _daoManager.GetDao(typeof(IOrderDao)) as IOrderDao; _printTaskDao = _daoManager.GetDao(typeof(IPrintTaskDao)) as IPrintTaskDao; _dailyStatementDao = _daoManager.GetDao(typeof(IDailyStatementDao)) as IDailyStatementDao; _sysConfigDao = _daoManager.GetDao(typeof(ISystemConfigDao)) as ISystemConfigDao; }
private OrderService() { _daoManager = ServiceConfig.GetInstance().DaoManager; _orderDao = _daoManager.GetDao(typeof(IOrderDao)) as IOrderDao; _printTaskDao = _daoManager.GetDao(typeof(IPrintTaskDao)) as IPrintTaskDao; _dailyStatementDao = _daoManager.GetDao(typeof(IDailyStatementDao)) as IDailyStatementDao; _sysConfigDao = _daoManager.GetDao(typeof(ISystemConfigDao)) as ISystemConfigDao; }
private ReminderOrderService() { _daoManager = ServiceConfig.GetInstance().DaoManager; _orderDao = _daoManager.GetDao(typeof(IOrderDao)) as IOrderDao; _orderDetailsDao = _daoManager.GetDao(typeof(IOrderDetailsDao)) as IOrderDetailsDao; _reasonDao = _daoManager.GetDao(typeof(IReasonDao)) as IReasonDao; _sysConfigDao = _daoManager.GetDao(typeof(ISystemConfigDao)) as ISystemConfigDao; _printTaskDao = _daoManager.GetDao(typeof(IPrintTaskDao)) as IPrintTaskDao; }
private PayingOrderService() { _daoManager = ServiceConfig.GetInstance().DaoManager; _orderDao = _daoManager.GetDao(typeof(IOrderDao)) as IOrderDao; _orderDetailsDao = _daoManager.GetDao(typeof(IOrderDetailsDao)) as IOrderDetailsDao; _orderDiscountDao = _daoManager.GetDao(typeof(IOrderDiscountDao)) as IOrderDiscountDao; _orderPayoffDao = _daoManager.GetDao(typeof(IOrderPayoffDao)) as IOrderPayoffDao; _dailyStatementDao = _daoManager.GetDao(typeof(IDailyStatementDao)) as IDailyStatementDao; }
private PayingOrderService() { _daoManager = ServiceConfig.GetInstance().DaoManager; _orderDao = _daoManager.GetDao(typeof(IOrderDao)) as IOrderDao; _orderDetailsDao = _daoManager.GetDao(typeof(IOrderDetailsDao)) as IOrderDetailsDao; _orderDiscountDao = _daoManager.GetDao(typeof(IOrderDiscountDao)) as IOrderDiscountDao; _orderPayoffDao = _daoManager.GetDao(typeof(IOrderPayoffDao)) as IOrderPayoffDao; _dailyStatementDao = _daoManager.GetDao(typeof(IDailyStatementDao)) as IDailyStatementDao; }
private ReminderOrderService() { _daoManager = ServiceConfig.GetInstance().DaoManager; _orderDao = _daoManager.GetDao(typeof(IOrderDao)) as IOrderDao; _orderDetailsDao = _daoManager.GetDao(typeof(IOrderDetailsDao)) as IOrderDetailsDao; _reasonDao = _daoManager.GetDao(typeof(IReasonDao)) as IReasonDao; _sysConfigDao = _daoManager.GetDao(typeof(ISystemConfigDao)) as ISystemConfigDao; _printTaskDao = _daoManager.GetDao(typeof(IPrintTaskDao)) as IPrintTaskDao; }
public void SetUp() { _dao = Substitute.For <IOrderDao>(); _dao.When(p => p.AddOrderLine(Arg.Any <OrderLine>())).Do(p => { p.Arg <OrderLine>().SalesOrder.Lines.Add(p.Arg <OrderLine>()); }); _dao.When(p => p.ClearOrder(Arg.Any <SalesOrder>())).Do(p => { p.Arg <SalesOrder>().Lines.Clear(); }); _uut = new OrderController(_dao); }
public OrderService(IOrderDao dao, IOrderPaymentDao orderPaymentDao, IPromotionDao promotionDao, IAccountDao accountDao, ICommandBus commandBus, IIBSServiceProvider ibsServiceProvider) { _orderPaymentDao = orderPaymentDao; _promotionDao = promotionDao; _accountDao = accountDao; _commandBus = commandBus; _ibsServiceProvider = ibsServiceProvider; Dao = dao; }
private System.Data.Entity.DbContext context;// = new DbContext(); //ICompanyRepository gcompanyRepository; public UnitOfWork(System.Data.Entity.DbContext _context, IProductDao _productDao, IOrderDao _orderDao, IShopDao _shopDao, IUserDao _userDao, ILineItemDao _lineItemDao) { context = _context; productDao = _productDao; orderDao = _orderDao; shopDao = _shopDao; lineItemDao = _lineItemDao; userDao = _userDao; }
public ActionResult ChangeStatusOrder(int orderId, int?statusId) { if (statusId != null) { IOrderDao orders = OrdersTableConnection.Instance; orders.UpdateOrderStatusById(orderId, (int)statusId); } return(RedirectToAction("Orders", "Courier")); }
public PlaysController() { loginsDb = LoginsTableConnection.Instance; datesDb = DatesTableConnection.Instance; ordersDb = OrdersTableConnection.Instance; playsDb = PlaysTableConnection.Instance; authorsDb = AuthorsTableConnection.Instance; genresDb = GenresTableConnection.Instance; }
private SalesOrderService() { _daoManager = ServiceConfig.GetInstance().DaoManager; _orderDao = _daoManager.GetDao(typeof(IOrderDao)) as IOrderDao; _orderDetailsDao = _daoManager.GetDao(typeof(IOrderDetailsDao)) as IOrderDetailsDao; _orderDiscountDao = _daoManager.GetDao(typeof(IOrderDiscountDao)) as IOrderDiscountDao; _orderPayoffDao = _daoManager.GetDao(typeof(IOrderPayoffDao)) as IOrderPayoffDao; _dailyStatementDao = _daoManager.GetDao(typeof(IDailyStatementDao)) as IDailyStatementDao; _sysConfigDao = _daoManager.GetDao(typeof(ISystemConfigDao)) as ISystemConfigDao; _sysDictionary = _daoManager.GetDao(typeof(ISystemDictionaryDao)) as ISystemDictionaryDao; _deskDao = _daoManager.GetDao(typeof(IDeskDao)) as IDeskDao; _printTaskDao = _daoManager.GetDao(typeof(IPrintTaskDao)) as IPrintTaskDao; _goodsDao = _daoManager.GetDao(typeof(IGoodsDao)) as IGoodsDao; }
public void SetUp() { _receiptController = Substitute.For<IReceiptController>(); _cashDrawer = Substitute.For<ICashDrawer>(); _productDao = Substitute.For<IProductDao>(); _paymentDao = Substitute.For<IPaymentDao>(); _orderDao = Substitute.For<IOrderDao>(); var paymentProviders = new List<IPaymentProvider> {new CashPayment()}; _productController = new ProductController(_productDao); _paymentController = new PaymentController(paymentProviders, _receiptController, _paymentDao, _cashDrawer); _orderController = new OrderController(_orderDao); _salesController = new SalesController(_orderController, _receiptController, _productController, _paymentController); }
public void SetUp() { _orderLines = new List<OrderLine>(); _receiptController = Substitute.For<IReceiptController>(); _productController = Substitute.For<IProductController>(); _cashDrawer = Substitute.For<ICashDrawer>(); _paymentDao = Substitute.For<IPaymentDao>(); _orderDao = Substitute.For<IOrderDao>(); _orderDao.When(x => x.AddOrderLine(Arg.Any<OrderLine>())).Do(x => _orderLines.Add(x.Arg<OrderLine>())); var paymentProviders = new List<IPaymentProvider>() { new CashPayment() }; _paymentController = new PaymentController(paymentProviders, _receiptController, _paymentDao, _cashDrawer); _orderController = new OrderController(_orderDao); _salesController = new SalesController(_orderController, _receiptController, _productController, _paymentController); }
public given_created_seat_assignments() { var conferenceDao = new Mock<IConferenceDao>(); conferenceDao.Setup(x => x.GetSeatTypeNames(It.IsAny<IEnumerable<Guid>>())) .Returns(seatTypes); var blobs = new MemoryBlobStorage(); this.dao = new OrderDao(() => new ConferenceRegistrationDbContext(dbName), blobs, new JsonTextSerializer()); this.sut = new SeatAssignmentsViewModelGenerator(conferenceDao.Object, blobs, new JsonTextSerializer()); this.sut.Handle(new SeatAssignmentsCreated { SourceId = assignmentsId, OrderId = orderId, Seats = new[] { new SeatAssignmentsCreated.SeatAssignmentInfo { Position = 0, SeatType = seatTypes[0].Id }, new SeatAssignmentsCreated.SeatAssignmentInfo { Position = 1, SeatType = seatTypes[1].Id }, } }); }
public void SetUp() { _orderLines = new List<OrderLine>(); _receiptController = Substitute.For<IReceiptController>(); _productController = Substitute.For<IProductController>(); _paymentController = Substitute.For<IPaymentController>(); _orderDao = Substitute.For<IOrderDao>(); _orderDao.When(x => x.AddOrderLine(Arg.Any<OrderLine>())).Do(x => _orderLines.Add(x.Arg<OrderLine>())); _orderController = new OrderController(_orderDao); _salesController = new SalesController(_orderController, _receiptController, _productController, _paymentController); }
public void SetUp() { _dao = Substitute.For<IOrderDao>(); _dao.When(p => p.AddOrderLine(Arg.Any<OrderLine>())).Do(p => { p.Arg<OrderLine>().SalesOrder.Lines.Add(p.Arg<OrderLine>()); }); _dao.When(p => p.ClearOrder(Arg.Any<SalesOrder>())).Do(p => { p.Arg<SalesOrder>().Lines.Clear(); }); _uut = new OrderController(_dao); }
/// <summary> /// Constructor /// </summary> /// <param name="orderDao">An IOrderDao implementation.</param> public OrderController(IOrderDao orderDao) { OrderDao = orderDao; CreateNewOrder(); _stashedOrders = new List<SalesOrder>(); }
private void SetupDataDao(int dataCount) { _OrderDao = Substitute.For<IOrderDao>(); var datas = new List<Order>(); for (var i = 1; i <= dataCount; i++) { var data = new Order { Id = i, Cost = i, Revenue = 10 + i, SellPrice = 20 + i }; datas.Add(data); } _OrderDao.GetOrders().Returns(datas); }
public PricedOrderController(ICommandBus commandBus, IOrderDao orderDao, IConferenceDao conferenceDao) { this._commandBus = commandBus; this._orderDao = orderDao; _conferenceDao = conferenceDao; }
public PaymentController(ICommandBus commandBus, IOrderDao orderDao, IConferenceDao conferenceDao) { _commandBus = commandBus; _orderDao = orderDao; _conferenceDao = conferenceDao; }
public given_a_read_model_generator() { var blobStorage = new MemoryBlobStorage(); this.sut = new PricedOrderViewModelGenerator(() => new ConferenceRegistrationDbContext(dbName)); this.dao = new OrderDao(() => new ConferenceRegistrationDbContext(dbName), blobStorage, new JsonTextSerializer()); }
public FinOrderManager() { financeDao = DAOFactory.GetInstance().GetFinanceDao(); orderDao = DAOFactory.GetInstance().GetOrderDao(); }
public RegistrationController(ICommandBus commandBus, IOrderDao orderDao, IConferenceDao conferenceDao) : base(conferenceDao) { this.commandBus = commandBus; this.orderDao = orderDao; }
public void SetUp() { _raisedEvent = 0; _discount = new Discount(); _product = new Product("Test", 100, true); _printer = Substitute.For<IPrinter>(); _cashDrawer = Substitute.For<ICashDrawer>(); _dalFacade = Substitute.For<IDalFacade>(); _productDao = new ProductDao(_dalFacade); _paymentDao = new PaymentDao(_dalFacade); _orderDao = new OrderDao(_dalFacade); _receiptController = new ReceiptController(_printer); _productController = new ProductController(_productDao); var paymentProviders = new List<IPaymentProvider> { new CashPayment() }; _paymentController = new PaymentController(paymentProviders, _receiptController, _paymentDao, _cashDrawer); _orderController = new OrderController(_orderDao); _salesController = new SalesController(_orderController, _receiptController, _productController, _paymentController); }
public void SetUp() { _salesOrderOne = new SalesOrder { Id = 1 }; var salesOrderTwo = new SalesOrder { Id = 2 }; _salesOrderThree = new SalesOrder { Id = 3 }; var salesOrders = new List<SalesOrder> { salesOrderTwo, _salesOrderOne, _salesOrderThree }; _dalFacade = Substitute.For<IDalFacade>(); _dalFacade.UnitOfWork.SalesOrderRepository .When(x => x.Get(null, Arg.Any<Func<IQueryable<SalesOrder>, IOrderedQueryable<SalesOrder>>>())) .Do(x => _orderedSalesOrders = x.Arg<Func<IQueryable<SalesOrder>, IOrderedQueryable<SalesOrder>>>().Invoke(salesOrders.AsQueryable()).ToList()); _dalFacade.UnitOfWork.SalesOrderRepository .Get(null, Arg.Any<Func<IQueryable<SalesOrder>, IOrderedQueryable<SalesOrder>>>()) .Returns(salesOrders); _uut = new OrderDao(_dalFacade); }
public OrderController(IConferenceDao conferenceDao, IOrderDao orderDao, ICommandBus bus) : base(conferenceDao) { this.orderDao = orderDao; this.bus = bus; }
public IOrderDao GetOrderDao() { if (orderDao == null) { if (!DataCache.Instance.OpenMySqlDb) { this.orderDao = new OrderDao(SQLiteDHelper); } else { this.orderDao = new OrderDaoMysql(MySqlDbHelper); } } return orderDao; }
public RegistrationController(IConferenceDao conferenceDao, IOrderDao orderDao, ICommandBus commandBus) { this._conferenceDao = conferenceDao; _orderDao = orderDao; _commandBus = commandBus; }
public Accounting(IOrderDao orderDao) { _OrderDao = orderDao; }