public void SetUp() { this.requestResource = new SernosConfigResource { Description = "new description", SerialNumbered = "N" }; var sernosConfig = new SernosConfig("name", "Y", 2, 3) { Description = "new description" }; this.SernosConfigService.Update("name", Arg.Any <SernosConfigResource>()) .Returns(new SuccessResult <SernosConfig>(sernosConfig) { Data = sernosConfig }); this.Response = this.Browser.Put( "/products/maint/sernos-configs/name", with => { with.Header("Accept", "application/json"); with.Header("Content-Type", "application/json"); with.JsonBody(this.requestResource); }).Result; }
public void SetUp() { var sernosConfig1 = new SernosConfig("name1", "Y", 2, 3); var sernosConfig2 = new SernosConfig("name2", "Y", 2, 3); this.SernosConfigService.GetAll() .Returns(new SuccessResult <IEnumerable <SernosConfig> >(new List <SernosConfig> { sernosConfig1, sernosConfig2 })); this.Response = this.Browser.Get( "/products/maint/sernos-configs", with => { with.Header("Accept", "application/json"); }).Result; }
public void SetUp() { var sernosConfig = new SernosConfig("name", "Y", 2, 3); this.SernosConfigService.GetById("name") .Returns(new SuccessResult <SernosConfig>(sernosConfig) { Data = sernosConfig }); this.Response = this.Browser.Get( "/products/maint/sernos-configs/name", with => { with.Header("Accept", "application/json"); }).Result; }
public void SetUp() { this.requestResource = new SernosConfigResource { Name = "c1" }; var sernosConfig = new SernosConfig("name", "Y", 2, 3); this.SernosConfigService.Add(Arg.Any <SernosConfigResource>()) .Returns(new CreatedResult <SernosConfig>(sernosConfig) { Data = sernosConfig }); this.Response = this.Browser.Post( "/products/maint/sernos-configs", with => { with.Header("Accept", "application/json"); with.Header("Content-Type", "application/json"); with.JsonBody(this.requestResource); }).Result; }
public void SetUpContext() { this.Sut = new SernosConfig("S", "Y", 1, 1); }