コード例 #1
0
 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));
 }
コード例 #2
0
        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.");
        }