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); }
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); }
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 })); }
public void AddOrUpdate_NullPrefix_Throw() { var sut = new PrefixDictionary <char, object>(); Assert.That(() => sut.AddOrUpdate(null, 1), Throws.ArgumentNullException); }