Skip to content

Instantly share code, notes, and snippets.

@wullemsb
Created February 17, 2024 10:21
[Fact]
public void SampleConcurrent_ConcurrentDictionary()
{
Gen.Dictionary(Gen.Int[0, 100], Gen.Byte)[0, 10].Select(l => new ConcurrentDictionary<int, byte>(l))
.SampleConcurrent(
Gen.Int[0, 100].Select(Gen.Byte)
.Operation<ConcurrentDictionary<int, byte>>(t => $"d[{t.Item1}] = {t.Item2}", (d, t) => d[t.Item1] = t.Item2),
Gen.Int[0, 100]
.Operation<ConcurrentDictionary<int, byte>>(i => $"TryRemove({i})", (d, i) => d.TryRemove(i, out _))
, writeLine:testOutputHelper.WriteLine);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment