private void CheckForbidden(QcouchDb db, string reason) { Assert.That(db.CouchApi.Responce.Code, Is.EqualTo(HttpStatusCode.Forbidden)); var responceTextFromJson=JObject.Parse(db.CouchApi.Responce.Text); var errorTxt=responceTextFromJson["error"].ToString(); var reasonTxt=responceTextFromJson["reason"].ToString(); Assert.That(errorTxt, Is.EqualTo("forbidden")); Assert.That(reasonTxt, Is.EqualTo(reason)); }
public void CreateRecordWithNoType() { var db=new QcouchDb(isSelfChecking:false); var api=db.CouchApi; db.CreateNew(); api.Add( Guid.NewGuid(), JObject.FromObject(new{ name="no description", wait_time_min=0 }) ); CheckForbidden(db,"The 'type' field is required."); }