예제 #1
0
        public void AddOrUpdate_NewPrefix_WithNullValue_Works(params object[] prefix)
        {
            var sut = new PrefixDictionary <object, object>();

            sut.Add(prefix, 1);
            Assert.That(() => sut.AddOrUpdate(prefix, null), Throws.Nothing);
        }
예제 #2
0
        public void AddOrUpdate_ExistingPrefix_Works(params object[] prefix)
        {
            var sut = new PrefixDictionary <object, object>();

            sut.Add(prefix, 1);
            Assert.That(() => sut.AddOrUpdate(prefix, 0), Throws.Nothing);
        }
예제 #3
0
        public void AddOrUpdate_Works(params object[] prefix)
        {
            var sut = new PrefixDictionary <object, object>();

            sut.Add(prefix, 0);
            sut.AddOrUpdate(prefix, 42);
            Assert.That(sut.GetMatches(prefix), Is.EquivalentTo(new[] { 42 }));
        }
예제 #4
0
        public void AddOrUpdate_NullPrefix_Throw()
        {
            var sut = new PrefixDictionary <char, object>();

            Assert.That(() => sut.AddOrUpdate(null, 1), Throws.ArgumentNullException);
        }