public async void Get_Customer_List_As_Parent_Customer()
        {
            IUserService userService = TestUtilities.GetUserService();
            IMapper      mapper      = TestUtilities.GetMapper(new CustomerProfile());
            IIsotopeOrderingAuthorizationService authorizationService = TestUtilities.GetAuthorizationService(Policies.CustomerPolicy);

            var mock = new Mock <ICustomerService>();

            mock.Setup(x => x.GetList <CustomerItemModel>())
            .Returns(Task.FromResult(new Fixture().CreateMany <CustomerItemModel>().ToList()));
            mock.Setup(x => x.GetCurrentCustomer <CustomerItemModel>())
            .Returns(Task.FromResult <CustomerItemModel?>(new CustomerItemModel()
            {
                Contact =
                {
                    Email     = userService.User.Email,
                    FirstName = userService.User.FirstName,
                    LastName  = userService.User.LastName,
                },
                ParentCustomerId = null
            }));
            mock.Setup(x => x.GetChildrenList <CustomerItemModel>(It.IsAny <int>()))
            .Returns(Task.FromResult(new Fixture().CreateMany <CustomerItemModel>().ToList()));

            CustomerManager manager = new CustomerManager(_logger, mapper, mock.Object, userService, authorizationService, _eventService, Mock.Of <INotificationService>());

            Assert.NotEmpty(await manager.GetList());
        }
 public DashboardManager(IIsotopeOrderingAuthorizationService authorization,
                         IFormService formService,
                         IOrderService orderService,
                         IShipmentService shipmentService)
 {
     _authorization   = authorization;
     _formService     = formService;
     _orderService    = orderService;
     _shipmentService = shipmentService;
 }
Example #3
0
 public OrderController(IOrderManager orderManager,
                        ICustomerManager customerManager,
                        IItemManager itemManager,
                        IIsotopeOrderingAuthorizationService authorizationService,
                        IShipmentManager shipmentManager)
 {
     _orderManager         = orderManager;
     _customerManager      = customerManager;
     _itemManager          = itemManager;
     _authorizationService = authorizationService;
     _shipmentManager      = shipmentManager;
 }
        public async void Get_Customer_Details()
        {
            IUserService userService = TestUtilities.GetUserService();
            IMapper      mapper      = TestUtilities.GetMapper(new CustomerProfile());
            IIsotopeOrderingAuthorizationService authorizationService = TestUtilities.GetAuthorizationService(Policies.AdminPolicy);
            var mock = new Mock <ICustomerService>();

            mock.Setup(x => x.Get <CustomerDetailModel>(It.IsAny <int>()))
            .ReturnsAsync(new Fixture().Create <CustomerDetailModel>());
            CustomerManager manager = new CustomerManager(_logger, mapper, mock.Object, userService, authorizationService, _eventService, Mock.Of <INotificationService>());

            Assert.NotNull(await manager.Get(1));
        }
 public ShipmentManager(
     ILogger <ShipmentManager> logger,
     IShipmentService service,
     IMapper mapper,
     ICustomerService customerService,
     IEventManager eventManager,
     IIsotopeOrderingAuthorizationService authorizationService)
 {
     _logger               = logger;
     _service              = service;
     _mapper               = mapper;
     _customerService      = customerService;
     _eventManager         = eventManager;
     _authorizationService = authorizationService;
 }
        public async void Get_Customer_List_As_Admin()
        {
            IUserService userService = TestUtilities.GetUserService();
            IMapper      mapper      = TestUtilities.GetMapper(new CustomerProfile());

            IIsotopeOrderingAuthorizationService authorizationService = TestUtilities.GetAuthorizationService(Policies.AdminPolicy);

            var mock = new Mock <ICustomerService>();

            mock.Setup(x => x.GetList <CustomerItemModel>())
            .Returns(Task.FromResult(new Fixture().CreateMany <CustomerItemModel>().ToList()));

            CustomerManager manager = new CustomerManager(_logger, mapper, mock.Object, userService, authorizationService, _eventService, Mock.Of <INotificationService>());

            Assert.NotEmpty(await manager.GetList());
        }
 public CustomerManager(ILogger <CustomerManager> logger,
                        IMapper mapper,
                        ICustomerService service,
                        IUserService userService,
                        IIsotopeOrderingAuthorizationService authorization,
                        IEventManager eventService,
                        INotificationService notificationService)
 {
     _logger              = logger;
     _mapper              = mapper;
     _service             = service;
     _userService         = userService;
     _authorization       = authorization;
     _eventService        = eventService;
     _notificationService = notificationService;
 }
 public FormManager(ILogger <FormManager> logger,
                    IMapper mapper,
                    IFormService service,
                    IItemService itemService,
                    IIsotopeOrderingAuthorizationService authorizationService,
                    ICustomerService customerService,
                    IEventManager eventService,
                    INotificationManager notificationManager)
 {
     _logger               = logger;
     _mapper               = mapper;
     _service              = service;
     _itemService          = itemService;
     _authorizationService = authorizationService;
     _customerService      = customerService;
     _eventService         = eventService;
     _notificationManager  = notificationManager;
 }