示例#1
0
        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));
        }
示例#2
0
        private static void TryGetValueInner(int i, MonsterIndexBackedIndex.View <int, string> target)
        {
            Assert.False(target.TryGetValue(i, out var _));

            Assert.True(target.TryAdd(i, "1"));

            Assert.True(target.TryGetValue(i, out var second));
            Assert.Equal("1", second);
        }