Example #1
0
        public void RemoveKeys()
        {
            // Arrange
            const string key1 = "TestKey1";
            const string key2 = "TestKey2";
            const string key3 = "TestKey3";

            _sut.Clear();

            var item1 = new TestObject(1, "Jane Smith");
            var item2 = new TestObject(2, "John Smith");
            var item3 = new TestObject(3, "Jade Smith");

            _sut.SetItem(key1, item1);
            _sut.SetItem(key2, item2);
            _sut.SetItem(key3, item3);

            // Act
            var keyNames = new string[] { key1, key2 };

            _sut.RemoveItems(keyNames);

            // Assert
            Assert.Equal(1, _sut.Length());
            Assert.NotNull(_sut.GetItem <TestObject>(key3));
        }