public void NewDictionary_BothShouldBeEmpty() { var dic = new DoubleDic <string, string>("XXX"); Assert.AreEqual(0, dic.Exposed.Count); Assert.AreEqual(0, dic.Redacted.Count); }
public void NullRedactedValue_ShouldBeNull() { const string sensitiveKey = "sensitive"; var dic = new DoubleDic <string, string>(null as string, sensitiveKey); dic[sensitiveKey] = "test"; Assert.IsNull(dic.Redacted[sensitiveKey]); }
public void AddingItems_ShouldBeReflectedInBoth() { var dic = new DoubleDic <string, string>("XXX"); const string test = "test"; dic[test] = test; Assert.AreEqual(test, dic.Exposed[test]); Assert.AreEqual(test, dic.Redacted[test]); }
public void RemovingItems_ShouldBeReflectedInBoth() { var dic = new DoubleDic <string, string>("XXX"); const string test = "test"; dic[test] = test; dic.Remove(test); Assert.ThrowsException <KeyNotFoundException>(() => dic.Exposed[test]); Assert.ThrowsException <KeyNotFoundException>(() => dic.Redacted[test]); }