public void WhenGoodBranchAndGoodInvoiceYieldGoodOrderWithItemInCatalog_ResultingDetailIsExpected()
            {
                // arrange
                MockDependents mockDependents = new MockDependents();
                IReportLogic   testunit       = MakeTestsLogic(false, ref mockDependents);

                mockDependents.ICatalogLogic.Setup(m => m.GetProductsByIds("FUT", new List <string> {
                    "111111"
                }))
                .Returns(new ProductsReturn {
                    Products = new List <Product> {
                        new Product {
                            ItemNumber = "111111",
                            Name       = "Fake Name",
                            BrandExtendedDescription = "Fake Brand",
                            ItemClass = "Fake Class",
                            Size      = "Fake Size",
                            Pack      = "2"
                        }
                    }
                });

                ItemUsageReportQueryModel testQuery = MakeQuery();
                string expected = "Fake Name / 111111 / Fake Brand / Fake Class / 2 / Fake Size";

                // act
                List <ItemUsageReportItemModel> result = testunit.GetItemUsage(testQuery);

                // assert
                result.First()
                .Detail
                .Should()
                .Be(expected);
            }
Beispiel #2
0
 public IReportLogic GetReportLogic()
 {
     if (_reportLogic == null)
     {
         _reportLogic = new ReportLogic(_configuration);
     }
     return(_reportLogic);
 }
Beispiel #3
0
        public static IReportLogic CreateInstance()
        {
            IApplicationContext context = ContextRegistry.GetContext();

            if (_instance == null && context != null)
            {
                _instance = context.GetObject("IReportLogic") as IReportLogic;
            }
            return(_instance);
        }
Beispiel #4
0
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="reportLogic"></param>
 /// <param name="profileLogic"></param>
 /// <param name="exportSettingsLogic"></param>
 /// <param name="inventoryValuationReportLogic"></param>
 /// <param name="logRepo"></param>
 public ReportController(IReportLogic reportLogic, IUserProfileLogic profileLogic, IExportSettingLogic exportSettingsLogic, ICatalogLogic catalogLogic,
                         IInventoryValuationReportLogic inventoryValuationReportLogic, IListService listService, IEventLogRepository logRepo)
     : base(profileLogic)
 {
     _exportLogic = exportSettingsLogic;
     _inventoryValuationReportLogic = inventoryValuationReportLogic;
     _reportLogic  = reportLogic;
     _listService  = listService;
     _catalogLogic = catalogLogic;
     _log          = logRepo;
 }
Beispiel #5
0
        public ReportController(IReportLogic reportLogic, IUserLogic userLogic, ICustomLogger customLogger)
        {
            if (reportLogic == null)
            {
                throw new ArgumentNullException("report's logic");
            }
            if (userLogic == null)
            {
                throw new ArgumentNullException("user's logic");
            }
            if (customLogger == null)
            {
                throw new ArgumentNullException("logger");
            }

            _reportLogic  = reportLogic;
            _customLogger = customLogger;
            _userLogic    = userLogic;

            UserLogicProvider.UserLogic = userLogic;
        }
            public void WhenGoodBranchAndGoodInvoiceYieldGoodOrderWithItemInCatalog_ResultingDetailIsNull()
            {
                // arrange
                MockDependents mockDependents = new MockDependents();
                IReportLogic   testunit       = MakeTestsLogic(false, ref mockDependents);

                mockDependents.ICatalogLogic.Setup(m => m.GetProductsByIds("FUT", new List <string> {
                    "111111"
                }))
                .Returns(new ProductsReturn {
                    Products = new List <Product>()
                });

                ItemUsageReportQueryModel testQuery = MakeQuery();

                // act
                List <ItemUsageReportItemModel> result = testunit.GetItemUsage(testQuery);

                // assert
                result.First()
                .Detail
                .Should()
                .BeNull();
            }
Beispiel #7
0
 public IReportModule SetReportLogic(IReportLogic reportLogic)
 {
     _reportLogic = reportLogic;
     return(this);
 }
Beispiel #8
0
 public ReportController(IReportLogic logic)
 {
     Logic = logic;
 }
 public ReportController(IReportLogic logic)
 {
     Logic = logic;
 }
 public ReportsController(IReportLogic reportLogic, IVisitSettingsLogic visitSettingLogic)
 {
     _reportLogic       = reportLogic;
     _visitSettingLogic = visitSettingLogic;
 }
 public ReportController(IReportLogic reportLogic)
 {
     this.reportLogic = reportLogic;
 }
 public ReportsController(ILogger <ReportsController> logger, IReportLogic reportLogic) : base()
 {
     this.logger      = logger;
     this.reportLogic = reportLogic;
 }
 public ReportsController(IReportLogic ReportLogic) : base()
 {
     this.ReportLogic = ReportLogic;
 }