public void SetUp() { this.cartonTypeName = "BigBox"; this.cartonTypeDescription = "It is a big box"; this.cartonType = new CartonType { CartonTypeName = this.cartonTypeName, Description = this.cartonTypeDescription }; this.CartonTypeFacadeService.GetById(this.cartonTypeName) .Returns(new SuccessResult <CartonType>(this.cartonType)); this.Response = this.Browser.Get( $"/logistics/carton-types/{this.cartonTypeName}", with => { with.Header("Accept", "application/json"); }).Result; }
public void SetUp() { this.requestResource = new CartonTypeUpdateResource { Description = "d1" }; var cartonType = new CartonType("c1", 1, 2, 3); this.CartonTypeService.Update("c1", Arg.Any <CartonTypeUpdateResource>()) .Returns(new SuccessResult <CartonType>(cartonType) { Data = cartonType }); this.Response = this.Browser.Put( "/products/maint/carton-types/c1", with => { with.Header("Accept", "application/json"); with.Header("Content-Type", "application/json"); with.JsonBody(this.requestResource); }).Result; }
public void SetUp() { this.cartonType1 = new CartonType { CartonTypeName = "C1" }; this.cartonType2 = new CartonType { CartonTypeName = "C2" }; this.CartonTypeFacadeService.GetAll() .Returns(new SuccessResult <IEnumerable <CartonType> >(new List <CartonType> { this.cartonType1, this.cartonType2 })); this.Response = this.Browser.Get( "/logistics/carton-types", with => { with.Header("Accept", "application/json"); }).Result; }
public void SetUp() { this.requestResource = new CartonTypeResource { Name = "c1" }; var cartonType = new CartonType("c1", 1, 2, 3); this.CartonTypeService.Add(Arg.Any <CartonTypeResource>()) .Returns(new CreatedResult <CartonType>(cartonType) { Data = cartonType }); this.Response = this.Browser.Post( "/products/maint/carton-types", with => { with.Header("Accept", "application/json"); with.Header("Content-Type", "application/json"); with.JsonBody(this.requestResource); }).Result; }