Ejemplo n.º 1
0
        public void SetUp()
        {
            this.resource = new ProductionTriggerLevelResource
            {
                PartNumber           = "part1",
                Description          = "desc",
                CitCode              = "cit1",
                VariableTriggerLevel = 1,
                OverrideTriggerLevel = 2,
                KanbanSize           = 1,
                MaximumKanbans       = 2,
                RouteCode            = "pcas1",
                WorkStationName      = "station1",
                FaZoneType           = "flex",
                EngineerId           = 33000,
                Temporary            = "Y",
                Story = string.Empty
            };
            var triggerLevel = new ProductionTriggerLevel
            {
                PartNumber           = "part1",
                Description          = "desc",
                CitCode              = "cit1",
                VariableTriggerLevel = 1,
                OverrideTriggerLevel = 2,
                KanbanSize           = 1,
                MaximumKanbans       = 2,
                RouteCode            = "pcas1",
                WorkStationName      = "station1",
                FaZoneType           = "flex",
                EngineerId           = 33000,
                Temporary            = "Y",
                Story = string.Empty
            };

            var responseModel = new ResponseModel <ProductionTriggerLevel>(
                triggerLevel,
                new List <string>());

            this.AuthorisationService.HasPermissionFor(AuthorisedAction.ProductionTriggerLevelUpdate, Arg.Any <List <string> >())
            .Returns(true);

            this.ProductionTriggerLevelService
            .Update(
                "part1",
                Arg.Any <ProductionTriggerLevelResource>(),
                Arg.Any <List <string> >()).Returns(
                new SuccessResult <ResponseModel <ProductionTriggerLevel> >(responseModel));

            this.Response = this.Browser.Put(
                "/production/maintenance/production-trigger-levels/part1",
                with =>
            {
                with.Header("Accept", "application/json");
                with.JsonBody(this.resource);
            }).Result;
        }
        public void SetUp()
        {
            var trigger = new ProductionTriggerLevel
            {
                PartNumber      = "AKUB PARTY",
                WorkStationName = string.Empty
            };

            this.ProductionTriggerLevelRepository.FindById(Arg.Any <string>()).Returns(trigger);
            this.result = this.Sut.GenerateWwdResultForTrigger("AKUB PARTY", 1, string.Empty);
        }
Ejemplo n.º 3
0
        public void SetUp()
        {
            var ptl1 = new ProductionTriggerLevel {
                PartNumber = "P1", Description = "d1"
            };

            this.ProductionTriggerLevelService.GetById("P1", Arg.Any <List <string> >())
            .Returns(new SuccessResult <ResponseModel <ProductionTriggerLevel> >(new ResponseModel <ProductionTriggerLevel>(ptl1, new List <string>())));

            this.Response = this.Browser.Get(
                "/production/maintenance/production-trigger-levels/P1",
                with =>
            {
                with.Header("Accept", "application/json");
            }).Result;
        }
Ejemplo n.º 4
0
        public void SetUp()
        {
            var trigger = new ProductionTriggerLevel
            {
                PartNumber      = "AKUB PARTY",
                WorkStationName = "AKUBSTATION"
            };

            this.ProductionTriggerLevelRepository.FindById(Arg.Any <string>()).Returns(trigger);

            var details = new List <WwdDetail>()
            {
                new WwdDetail
                {
                    PartNumber    = "AKUB SPKR",
                    Description   = "SOUND MAKING BIT",
                    QtyAtLocation = 1,
                    QtyKitted     = 0,
                    QtyReserved   = 0,
                    StoragePlace  = "P666",
                    Remarks       = string.Empty
                },
                new WwdDetail
                {
                    PartNumber    = "AKUB PYRO",
                    Description   = "NO PYRO NO PARTY",
                    QtyAtLocation = 0,
                    QtyKitted     = 0,
                    QtyReserved   = 0,
                    StoragePlace  = "E-FA-STANDS",
                    Remarks       = "Remember kids fireworks are dangerous"
                }
            };

            this.WwdDetailRepository.FilterBy(Arg.Any <Expression <Func <WwdDetail, bool> > >()).Returns(details.AsQueryable());

            this.WwdTrigFunction.WwdTriggerRun(Arg.Any <string>(), Arg.Any <int>()).Returns(1);
            this.result = this.Sut.GenerateWwdResultForTrigger("AKUB PARTY", 1, string.Empty);
        }
Ejemplo n.º 5
0
        public void SetUp()
        {
            var ptl1 = new ProductionTriggerLevel {
                PartNumber = "pcas1", Description = "d1"
            };
            var ptl2 = new ProductionTriggerLevel {
                PartNumber = "pcas2", Description = "d2"
            };
            var requestResource = new ProductionTriggerLevelsSearchRequestResource
            {
                SearchTerm         = "pcas",
                CitSearchTerm      = "S",
                AutoSearchTerm     = "0",
                OverrideSearchTerm = "0",
            };

            this.ProductionTriggerLevelService.Search(
                Arg.Is <ProductionTriggerLevelsSearchRequestResource>(
                    x => x.CitSearchTerm == "S" && x.SearchTerm == "pcas" && x.AutoSearchTerm == "0" && x.OverrideSearchTerm == "0"),
                Arg.Any <IEnumerable <string> >())
            .Returns(new SuccessResult <ResponseModel <IEnumerable <ProductionTriggerLevel> > >(
                         new ResponseModel <IEnumerable <ProductionTriggerLevel> >(
                             new List <ProductionTriggerLevel> {
                ptl1, ptl2
            },
                             new List <string>())));

            this.Response = this.Browser.Get(
                "/production/maintenance/production-trigger-levels",
                with =>
            {
                with.Header("Accept", "application/json");
                with.Query("SearchTerm", requestResource.SearchTerm);
                with.Query("AutoSearchTerm", requestResource.AutoSearchTerm);
                with.Query("OverrideSearchTerm", requestResource.OverrideSearchTerm);
                with.Query("CitSearchTerm", requestResource.CitSearchTerm);
            }).Result;
        }
Ejemplo n.º 6
0
        public void SetUp()
        {
            var ptl1 = new ProductionTriggerLevel {
                PartNumber = "pcas1", Description = "d1"
            };
            var ptl2 = new ProductionTriggerLevel {
                PartNumber = "pcas2", Description = "d2"
            };

            this.ProductionTriggerLevelService.GetAll(Arg.Any <List <string> >())
            .Returns(new SuccessResult <ResponseModel <IEnumerable <ProductionTriggerLevel> > >(
                         new ResponseModel <IEnumerable <ProductionTriggerLevel> >(
                             new List <ProductionTriggerLevel> {
                ptl1, ptl2
            },
                             new List <string>())));

            this.Response = this.Browser.Get(
                "/production/maintenance/production-trigger-levels",
                with =>
            {
                with.Header("Accept", "application/json");
            }).Result;
        }