public void Delete_One_Row() { var delete = new Delete.Builder() .WithTable(Table) .WithKey(KeyToDelete) .Build(); RiakResult rslt = client.Execute(delete); Assert.IsTrue(rslt.IsSuccess, rslt.ErrorMessage); Assert.IsFalse(delete.Response.NotFound); var get = new Get.Builder() .WithTable(Table) .WithKey(KeyToDelete) .Build(); rslt = client.Execute(get); Assert.IsTrue(rslt.IsSuccess, rslt.ErrorMessage); Assert.IsTrue(get.Response.NotFound); var store = new Store.Builder() .WithTable(Table) .WithRow(RowToRestore) .Build(); rslt = client.Execute(store); Assert.IsTrue(rslt.IsSuccess, rslt.ErrorMessage); }
Delete _Delete(object item) { var c = new Delete.Builder(); var k = Serializer.Key(item); c.WithTable(Name).WithKey(k); return(c.Build()); }
void _Delete(object item) { var e = _Entity(item); var t = _tables[e]; var s = _serializers.Get(e); var c = _delete[item] = new Delete.Builder(); var k = s.Key(item); c.WithTable(t.Name).WithKey(k); }
public void Should_Build_Req() { var cmd = new Delete.Builder() .WithTable(Table) .WithKey(Key) .Build(); Assert.AreEqual(MessageCode.TsDelResp, cmd.ExpectedCode); TsDelReq pb = (TsDelReq)cmd.ConstructRequest(false); Assert.AreEqual(Table, RiakString.FromBytes(pb.table)); Assert.IsFalse(pb.timeoutSpecified); }
public void Should_Build_Req() { var cmd = new Delete.Builder() .WithTable(Table) .WithKey(Key) .Build(); Assert.AreEqual(MessageCode.TsDelResp, cmd.ExpectedCode); TsDelReq pb = (TsDelReq)cmd.ConstructPbRequest(); Assert.AreEqual(Table, RiakString.FromBytes(pb.table)); Assert.IsFalse(pb.timeoutSpecified); }
public void Should_Build_Req_With_Timeout() { var cmd = new Delete.Builder() .WithTable(Table) .WithKey(Key) .WithTimeout(Timeout) .Build(); Assert.AreEqual(MessageCode.TsDelResp, cmd.ExpectedCode); TsDelReq pb = (TsDelReq)cmd.ConstructRequest(false); Assert.AreEqual(Table, RiakString.FromBytes(pb.table)); Assert.IsTrue(pb.timeoutSpecified); Assert.AreEqual(Timeout.TotalMilliseconds, pb.timeout); }