Exemplo n.º 1
0
        public void FixtureInit()
        {
            const string testFileName  = @"DataFiles\Chevron June FG 462988.xlsx";
            var          directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase);

            if (directoryName == null)
            {
                return;
            }

            var projectPath = directoryName.Replace("file:\\", "").Replace("\\bin\\Debug", "");

            _extractor = new OrderLineExtractor();
            //_extractor.SourcePath = Path.Combine(projectPath, testFileName);
            _shipService         = A.Fake <IShippingCostService>();
            _templatePathService = new HardCodedTemplatePathService();

            A.CallTo(() => _shipService.BoxFee).Returns(2.50m);
            A.CallTo(() => _shipService.PickPackFee).Returns(0.50m);

            _invoiceService            = new InvoiceService(_extractor, _shipService, _templatePathService);
            _invoiceService.SourcePath = Path.Combine(projectPath, testFileName);
            _freightPurchaseOrders     = _invoiceService.GetFreightPurchaseOrders("462988");
            _productPurchaseOrders     = _invoiceService.GetProductPurchaseOrders("462988");
        }
Exemplo n.º 2
0
        public void FixtureInit()
        {
            const string testFileName = @"DataFiles\Chevron June FG 462988.xlsx";
            var          projectPath  = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase)
                                        .Replace("file:\\", "")
                                        .Replace("\\bin\\Debug", "");

            _extractor            = new OrderLineExtractor();
            _extractor.SourcePath = Path.Combine(projectPath, testFileName);
            _dtos = _extractor.Extract();
        }
        public void FixtureInit()
        {
            var directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase);

            if (directoryName == null)
            {
                return;
            }

            _projectPath = directoryName.Replace("file:\\", "").Replace("bin\\Debug", "DataFiles");

            _extractor       = new OrderLineExtractor();
            _shipService     = A.Fake <IShippingCostService>();
            _templateService = A.Fake <ITemplatePathService>();

            _invoiceService            = new InvoiceService(_extractor, _shipService, _templateService);
            _invoiceService.SourcePath = Path.Combine(_projectPath, TestFileName);

            A.CallTo(() => _shipService.PickPackFee).Returns(0.50m);
            A.CallTo(() => _shipService.BoxFee).Returns(2.50m);
        }