public void SetUp() { var l = new WorksOrderLabel { Sequence = 1, PartNumber = "PART", LabelText = "hello" }; this.LabelService.GetById(Arg.Any <WorksOrderLabelKey>()).Returns(new SuccessResult <WorksOrderLabel>(l)); this.Response = this.Browser.Get( "/production/works-orders/labels/1/PART", with => { with.Header("Accept", "application/json"); }).Result; }
public void SetUp() { var l = new WorksOrderLabel { Sequence = 1, PartNumber = "PART", LabelText = "text" }; this.requestResource = new WorksOrderLabelResource { Sequence = 1, PartNumber = "PART", LabelText = "new text" }; this.LabelService.Update(Arg.Any <WorksOrderLabelKey>(), Arg.Any <WorksOrderLabelResource>()).Returns(new SuccessResult <WorksOrderLabel>(l)); this.Response = this.Browser.Put( "/production/works-orders/labels/1/PART", with => { with.Header("Accept", "application/json"); with.JsonBody(this.requestResource); }).Result; }
public void SetUp() { this.searchTerm = "PART"; var l1 = new WorksOrderLabel { PartNumber = "PART", Sequence = 1 }; var l2 = new WorksOrderLabel { PartNumber = "PART", Sequence = 2 }; this.LabelService.Search(this.searchTerm) .Returns(new SuccessResult <IEnumerable <WorksOrderLabel> >(new List <WorksOrderLabel> { l1, l2 })); this.Response = this.Browser.Get( "/production/works-orders/labels", with => { with.Header("Accept", "application/json"); with.Query("searchTerm", this.searchTerm); }).Result; }
public void SetUp() { var requestResource = new WorksOrderLabelResource { PartNumber = "PART", Sequence = 1, }; var label = new WorksOrderLabel { PartNumber = "PART", Sequence = 1, }; this.LabelService.Add(Arg.Any <WorksOrderLabelResource>()) .Returns(new CreatedResult <WorksOrderLabel>(label)); this.Response = this.Browser.Post( "/production/works-orders/labels", with => { with.Header("Accept", "application/json"); with.Header("Content-Type", "application/json"); with.JsonBody(requestResource); }).Result; }