public void SetUp() { var ateFaultCode1 = new AteFaultCode("F1"); var ateFaultCode2 = new AteFaultCode("F2"); this.AteFaultCodeService.GetAll() .Returns(new SuccessResult <IEnumerable <AteFaultCode> >(new List <AteFaultCode> { ateFaultCode1, ateFaultCode2 })); this.Response = this.Browser.Get( "/production/quality/ate/fault-codes/", with => { with.Header("Accept", "application/json"); }).Result; }
public void SetUp() { var ateFaultCode = new AteFaultCode("FAULT") { Description = "Desc" }; this.AteFaultCodeService.GetById("FAULT") .Returns(new SuccessResult <AteFaultCode>(ateFaultCode)); this.Response = this.Browser.Get( "/production/quality/ate/fault-codes/FAULT", with => { with.Header("Accept", "application/json"); }).Result; }
public void SetUp() { this.requestResource = new AteFaultCodeResource { FaultCode = "F1" }; var ateFaultCode = new AteFaultCode("F1"); this.AteFaultCodeService.Add(Arg.Any <AteFaultCodeResource>()) .Returns(new CreatedResult <AteFaultCode>(ateFaultCode)); this.Response = this.Browser.Post( "/production/quality/ate/fault-codes/", with => { with.Header("Accept", "application/json"); with.Header("Content-Type", "application/json"); with.JsonBody(this.requestResource); }).Result; }
public void SetUp() { this.requestResource = new AteFaultCodeResource { FaultCode = "F1", Description = "Desc" }; var ateFaultCode = new AteFaultCode("F1") { Description = "Desc" }; this.AteFaultCodeService.Update("F1", Arg.Any <AteFaultCodeResource>()) .Returns(new SuccessResult <AteFaultCode>(ateFaultCode)); this.Response = this.Browser.Put( "/production/quality/ate/fault-codes/F1", with => { with.Header("Accept", "application/json"); with.Header("Content-Type", "application/json"); with.JsonBody(this.requestResource); }).Result; }