public void Replace_NullKey()
        {
            var dictionary = new BidirectionalDictionary <string, string> ();
            var ex         = Assert.Throws <ArgumentNullException> (() => dictionary.Replace(null, String1));

            Assert.AreEqual("key", ex.ParamName);
        }
        public void Replace_NullValue()
        {
            var dictionary = new BidirectionalDictionary <string, string> ();
            var ex         = Assert.Throws <ArgumentNullException> (() => dictionary.Replace(String1, null));

            Assert.AreEqual("value", ex.ParamName);
        }
        public void Replace()
        {
            var dictionary = new BidirectionalDictionary <int, string> ();

            dictionary.Replace(42, String1);
            Assert.AreEqual(String1, dictionary [42]);
        }
        public void Replace_ExistingValue()
        {
            var dictionary = new BidirectionalDictionary <int, string> ();

            dictionary.Add(42, String1);
            dictionary.Replace(67, String2);
            Assert.AreEqual(String2, dictionary [67]);
        }
        public void Replace_ExistingKeyAndValue()
        {
            var dictionary = new BidirectionalDictionary <int, string> ();

            dictionary.Add(42, String1);
            dictionary.Add(67, String2);
            dictionary.Replace(42, String2);

            Assert.That(!dictionary.ContainsKey(67), "Did not remove key 67");
            Assert.That(!dictionary.ContainsValue(String1), "Did not remove value String1");
            Assert.That(dictionary [42], Is.EqualTo(String2), "Did not add mapping 42 -> String2");
        }