public static void BatchMove(string bucket, string[] keys) { List<EntryPathPair> pairs = new List<EntryPathPair>(); foreach (string key in keys) { EntryPathPair entry = new EntryPathPair(bucket, key, Guid.NewGuid().ToString()); pairs.Add(entry); } RSClient client = new RSClient(); client.BatchMove(pairs.ToArray()); }
public void BatchMoveTest() { RSClient target = new RSClient(); // TODO: 初始化为适当的值 EntryPathPair[] entryPathPairs = new EntryPathPair[2]; // TODO: 初始化为适当的值 string tmpKey = NewKey; string tmpKey2 = NewKey; entryPathPairs[0] = new EntryPathPair(Bucket, tmpKeys[0], tmpKey); entryPathPairs[1] = new EntryPathPair(Bucket, tmpKeys[1], tmpKey2); CallRet actual; actual = target.BatchMove(entryPathPairs); if (actual.OK) { tmpKeys [0] = tmpKey; tmpKeys [1] = tmpKey2; } Assert.IsTrue(actual.OK, "BatchMoveTest Failure"); }