public void SetUp()
        {
            this.manufacturingRoute = new ManufacturingRoute("112", "desc", "note");

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

            this.result = this.Sut.Build(new ResponseModel <ManufacturingRoute>(this.manufacturingRoute, new List <string>()));
        }
Beispiel #2
0
        public void SetUp()
        {
            this.manufacturingRoute = new ManufacturingRoute("code red", "wood chuck chuck", "noted");

            this.resource = new ManufacturingRouteResource
            {
                RouteCode = "code red", Description = "wood chuck chuck", Notes = "noted"
            };

            this.result = this.Sut.Add(this.resource);
        }
Beispiel #3
0
        public void SetUp()
        {
            var route = new ManufacturingRoute("TESTCODE", "desc", "a note");

            route.Operations = new List <ManufacturingOperation>();

            this.ManufacturingRouteService.GetById("TESTCODE", Arg.Any <List <string> >())
            .Returns(new SuccessResult <ResponseModel <ManufacturingRoute> >(new ResponseModel <ManufacturingRoute>(route, new List <string>())));

            this.Response = this.Browser.Get(
                "/production/resources/manufacturing-routes/TESTCODE",
                with => { with.Header("Accept", "application/json"); }).Result;
        }
Beispiel #4
0
        public void SetUp()
        {
            var a = new ManufacturingRoute("code1", "desc1", "a note");
            var b = new ManufacturingRoute("code2", "desc2", "second note");

            a.Operations = new List <ManufacturingOperation>();
            b.Operations = new List <ManufacturingOperation>();

            this.AuthorisationService.HasPermissionFor(AuthorisedAction.ManufacturingRouteUpdate, Arg.Any <List <string> >())
            .Returns(true);
            this.ManufacturingRouteService.Search("code", Arg.Any <List <string> >())
            .Returns(new SuccessResult <ResponseModel <IEnumerable <ManufacturingRoute> > >(new ResponseModel <IEnumerable <ManufacturingRoute> >(new List <ManufacturingRoute> {
                a, b
            }, new List <string>())));

            this.Response = this.Browser.Get(
                "/production/resources/manufacturing-routes",
                with => { with.Header("Accept", "application/json"); with.Query("searchTerm", "code"); }).Result;
        }
Beispiel #5
0
        public void SetUp()
        {
            this.requestRoute = new ManufacturingRouteResource {
                RouteCode = "ADD TEST", Description = "Descrip", Notes = "some extra info"
            };
            var newRoute = new ManufacturingRoute("ADD TEST", "Descrip", "some extra info");

            this.AuthorisationService.HasPermissionFor(AuthorisedAction.ManufacturingRouteUpdate, Arg.Any <List <string> >())
            .Returns(true);
            this.ManufacturingRouteService.Add(Arg.Any <ManufacturingRouteResource>(), Arg.Any <List <string> >())
            .Returns(new CreatedResult <ResponseModel <ManufacturingRoute> >(new ResponseModel <ManufacturingRoute>(responseData: newRoute, privileges: new List <string>())));

            this.Response = this.Browser.Post(
                "/production/resources/manufacturing-routes",
                with =>
            {
                with.Header("Accept", "application/json");
                with.Header("Content-Type", "application/json");
                with.JsonBody(this.requestRoute);
            }).Result;
        }
Beispiel #6
0
        public void SetUp()
        {
            this.requestResource = new ManufacturingRouteResource()
            {
                RouteCode = "MYTEST", Description = "Desc1", Notes = "extra info"
            };
            var route = new ManufacturingRoute("MYTEST", "Desc1", "extra info");

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

            this.ManufacturingRouteService.Update("MYTEST", Arg.Any <ManufacturingRouteResource>(), Arg.Any <List <string> >())
            .Returns(new SuccessResult <ResponseModel <ManufacturingRoute> >(new ResponseModel <ManufacturingRoute>(route, new List <string>())));

            this.Response = this.Browser.Put(
                "/production/resources/manufacturing-routes/MYTEST",
                with =>
            {
                with.Header("Accept", "application/json");
                with.Header("Content-Type", "application/json");
                with.JsonBody(this.requestResource);
            }).Result;
        }
Beispiel #7
0
        public void SetUp()
        {
            this.manufacturingRoute      = new ManufacturingRoute("code red", "wood chuck chuck", "noted");
            this.manufacturingOperations = new List <ManufacturingOperation>
            {
                new ManufacturingOperation(
                    this.routeCode,
                    77,
                    15,
                    "descrip of op",
                    "codeOfOperation",
                    "res Code",
                    27,
                    54,
                    5,
                    "cit code test"),
                new ManufacturingOperation(
                    this.routeCode,
                    78,
                    16,
                    "descripop",
                    "sklcode",
                    "rescd",
                    28,
                    55,
                    6,
                    "code test")
            };
            this.manufacturingRoute.Operations = this.manufacturingOperations;

            this.opResources = new List <ManufacturingOperationResource>
            {
                new ManufacturingOperationResource
                {
                    RouteCode        = this.routeCode,
                    ManufacturingId  = 77,
                    OperationNumber  = 15,
                    Description      = "descrip of op",
                    SkillCode        = "codeOfOperation",
                    ResourceCode     = "res Code",
                    SetAndCleanTime  = 27,
                    CycleTime        = 54,
                    LabourPercentage = 5,
                    CITCode          = "cit code test"
                },
                new ManufacturingOperationResource
                {
                    RouteCode        = this.routeCode,
                    ManufacturingId  = 78,
                    OperationNumber  = 16,
                    Description      = "descripop",
                    SkillCode        = "sklcode",
                    ResourceCode     = "rescd",
                    SetAndCleanTime  = 28,
                    CycleTime        = 55,
                    LabourPercentage = 6,
                    CITCode          = "code test"
                }
            };
            this.resource = new ManufacturingRouteResource
            {
                RouteCode   = this.routeCode,
                Description = "wood chuck chuck",
                Notes       = "noted",
                Operations  = this.opResources
            };

            this.ManufacturingRouteRepository.FindById(this.routeCode).Returns(this.manufacturingRoute);

            this.ManufacturingOperationRepository.FindById(77)
            .Returns(this.manufacturingOperations.First(x => x.ManufacturingId == 77));

            this.result = this.Sut.Update(this.routeCode, this.resource);
        }