Ejemplo n.º 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);
        }
Ejemplo n.º 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>());
        }
Ejemplo n.º 3
0
        public void RemoveMapEntryEmpty()
        {
            Replacer replacer = new Replacer();

            Assert.That(
                () => replacer.Remove("a"),
                Throws.InstanceOf <KeyNotFoundException>());
        }
Ejemplo n.º 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));
        }