private static void AddOrUpdateInner(int i, MonsterIndexBackedIndex.View <int, string> thing) { thing.AddOrUpdate(i, "hello"); Assert.Equal("hello", thing.GetOrThrow(i)); thing.AddOrUpdate(i, "world hello"); Assert.Equal("world hello", thing.GetOrThrow(i)); }
private static void GetOrThrowInner(int i, MonsterIndexBackedIndex.View <int, string> target) { Assert.ThrowsAny <Exception>(() => target.GetOrThrow(i)); Assert.True(target.TryAdd(i, "1")); Assert.Equal("1", target.GetOrThrow(i)); }