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>())); }
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); }
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; }
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; }
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); }