MCPcopy Create free account
hub / github.com/apache/thrift / testMap

Method testMap

test/netstd/Server/TestServer.cs:299–322  ·  view source on GitHub ↗
(Dictionary<int, int>? thing, CancellationToken cancellationToken)

Source from the content-addressed store, hash-verified

297 }
298
299 public Task<Dictionary<int, int>> testMap(Dictionary<int, int>? thing, CancellationToken cancellationToken)
300 {
301 var sb = new StringBuilder();
302 sb.Append("testMap({{");
303 if (thing != null)
304 {
305 var first = true;
306 foreach (var key in thing.Keys)
307 {
308 if (first)
309 {
310 first = false;
311 }
312 else
313 {
314 sb.Append(", ");
315 }
316 sb.AppendFormat("{0} => {1}", key, thing[key]);
317 }
318 }
319 sb.Append("}})");
320 logger.Invoke(sb.ToString());
321 return Task.FromResult(thing ?? []); // null returns are not allowed in Thrift
322 }
323
324 public Task<Dictionary<string, string>> testStringMap(Dictionary<string, string>? thing, CancellationToken cancellationToken)
325 {

Callers 1

ExecuteClientTestMethod · 0.45

Calls 2

InvokeMethod · 0.80
ToStringMethod · 0.80

Tested by

no test coverage detected