public void SetUp()
        {
            this.triggerLevels = new List <ProductionTriggerLevel>
            {
                new ProductionTriggerLevel {
                    PartNumber = "P1", KanbanSize = 1, VariableTriggerLevel = 2, OverrideTriggerLevel = 3, CitCode = "C"
                },
                new ProductionTriggerLevel {
                    PartNumber = "P2", KanbanSize = 4, VariableTriggerLevel = 1, CitCode = "D"
                }
            };
            var salesArticle1 = new SalesArticle
            {
                ArticleNumber      = "P1",
                InvoiceDescription = "a1d",
                SaCoreType         = new SaCoreType(1, "one")
            };
            var salesArticle2 = new SalesArticle
            {
                ArticleNumber      = "P2",
                InvoiceDescription = "b2d",
                SaCoreType         = new SaCoreType(2, "two")
            };

            this.ProductionTriggerLevelsService.GetAll().Returns(this.triggerLevels.AsQueryable());
            this.SalesArticleRepository.FilterBy(Arg.Any <Expression <Func <SalesArticle, bool> > >())
            .Returns(new List <SalesArticle> {
                salesArticle1, salesArticle2
            }.AsQueryable());

            this.Results = this.Sut.SalesArticleTriggerLevelsReport();
        }
Пример #2
0
 public void SetUpContext()
 {
     this.Sut = new SalesArticle
     {
         ArticleNumber      = "Article",
         InvoiceDescription = "Description"
     };
 }
Пример #3
0
        public void SetUp()
        {
            var salesArticle = new SalesArticle
            {
                ArticleNumber      = "article",
                TypeOfSerialNumber = "P1"
            };

            this.SalesArticleRepository.FindById("article").Returns(salesArticle);
            this.SernosPack.GetProductGroup("article").Returns("group");

            this.result = this.Sut.GetSerialNumberDetails("article");
        }
        public void SetUp()
        {
            this.salesArticle = new SalesArticle {
                ArticleNumber = "sa"
            };
            this.SalesArticleForecastService.GetById("SA", Arg.Any <List <string> >()).Returns(new SuccessResult <ResponseModel <SalesArticle> >(new ResponseModel <SalesArticle>(this.salesArticle, null)));

            this.Response = this.Browser.Get(
                "/products/maint/sales-articles/sa",
                with =>
            {
                with.Header("Accept", "application/json");
            }).Result;
        }
Пример #5
0
        public IActionResult OnGet(string id)
        {
            if (id == null)
            {
                return(this.NotFound());
            }

            this.SalesArticle = this.salesArticleRepository.GetByArticleNumber(id);

            if (this.SalesArticle == null)
            {
                return(this.NotFound());
            }

            return(this.Page());
        }
Пример #6
0
        public void SetUp()
        {
            var salesArticle = new SalesArticle {
                ArticleNumber = "sa"
            };
            var responseModel = new ResponseModel <SalesArticle>(salesArticle, null);

            this.SalesArticleForecastService.GetById("SA", Arg.Any <IEnumerable <string> >()).Returns(new SuccessResult <ResponseModel <SalesArticle> >(responseModel));

            this.Response = this.Browser.Get(
                "/products/maint/sales-articles",
                with =>
            {
                with.Header("Accept", "application/json");
                with.Query("articleNumber", "sa");
            }).Result;
        }
Пример #7
0
 public void SetUp()
 {
     this.salesArticle = new SalesArticle
     {
         ArticleNumber  = "sa",
         ForecastType   = "N",
         ForecastToDate = 1.December(2019)
     };
     this.coreType = new SaCoreType(1, "thing");
     this.resource = new SalesArticleResource
     {
         ArticleNumber  = "sa",
         Description    = "new desc",
         ForecastType   = "Y",
         ForecastToDate = 1.December(2020).ToString("o"),
         Links          = new LinkResource[] { new LinkResource("sa-core-type", string.Empty) }
     };
     this.SalesArticleRepository.FindById("sa")
     .Returns(this.salesArticle);
     this.SaCoreTypeRepository.FindById(1)
     .Returns(this.coreType);
     this.result = this.Sut.Update("sa", this.resource);
 }
Пример #8
0
        public void SetUp()
        {
            var salesArticle = new SalesArticle {
                ArticleNumber = "sa"
            };
            var responseModel = new ResponseModel <SalesArticle>(salesArticle, null);

            this.resource = new SalesArticleResource
            {
                ForecastType     = "Y",
                ForecastFromDate = 1.December(2020).ToString("o")
            };
            this.SalesArticleForecastService.Update("SA", Arg.Any <SalesArticleResource>(), Arg.Any <IEnumerable <string> >())
            .Returns(new SuccessResult <ResponseModel <SalesArticle> >(responseModel));

            this.Response = this.Browser.Put(
                "/products/maint/sales-articles/sa",
                with =>
            {
                with.Header("Accept", "application/json");
                with.Header("Content-Type", "application/json");
                with.JsonBody(this.resource);
            }).Result;
        }