예제 #1
0
        public void TestRemovesCorrectly()
        {
            var registry = new SendableRegistry();

            var sendableMock = new Mock <ISendable>();

            const string name = "mysendable";

            registry.Add(sendableMock.Object, name);

            Assert.True(registry.Contains(sendableMock.Object));

            Assert.True(registry.Remove(sendableMock.Object));

            Assert.False(registry.Contains(sendableMock.Object));

            Assert.Empty(registry.GetName(sendableMock.Object));
        }