Example #1
0
        public void RemoveEmptyMapEntry()
        {
            Replacer replacer = new Replacer();

            replacer.Add("a", "b");
            Assert.That(
                () => replacer.Remove(string.Empty),
                Throws.ArgumentNullException);
            Assert.That(
                () => replacer.Remove(null),
                Throws.ArgumentNullException);
        }
Example #2
0
        public void RemoveFakeMapEntry()
        {
            Replacer replacer = new Replacer();

            replacer.Add("a", "b");
            Assert.That(
                () => replacer.Remove("c"),
                Throws.InstanceOf <KeyNotFoundException>());
            Assert.That(
                () => replacer.Remove("b"),
                Throws.InstanceOf <KeyNotFoundException>());
        }
Example #3
0
        public void RemoveMapEntryEmpty()
        {
            Replacer replacer = new Replacer();

            Assert.That(
                () => replacer.Remove("a"),
                Throws.InstanceOf <KeyNotFoundException>());
        }
Example #4
0
        public void RemoveMapEntry()
        {
            Replacer replacer = new Replacer();

            replacer.Add("a", "b");
            Assert.That(replacer.Map.Count, Is.EqualTo(1));
            replacer.Remove("a");
            Assert.That(replacer.Map.Count, Is.EqualTo(0));
        }