public void TestAddAndCount()
        {
            var collection = new DummySmtpServerConnectionCollection();

            collection.Add(Substitute.For <IDummySmtpServerConnection>());
            Assert.That(collection.Count, Is.EqualTo(1));
        }
        public void TestWaitForEmptyBlocksOnNonEmptyCollection()
        {
            var collection = new DummySmtpServerConnectionCollection();
            var connection = Substitute.For <IDummySmtpServerConnection>();

            collection.Add(connection);
            Assert.False(collection.WaitTillEmpty(250));
        }
        public void TestWaitForEmptyUnblocksWhenCollectionEmptied()
        {
            var collection = new DummySmtpServerConnectionCollection();
            var connection = Substitute.For <IDummySmtpServerConnection>();

            collection.Add(connection);
            collection.Remove(connection);
            Assert.True(collection.WaitTillEmpty());
        }
        public void TestRemoveAndCount()
        {
            var collection = new DummySmtpServerConnectionCollection();
            var connection = Substitute.For <IDummySmtpServerConnection>();

            collection.Add(connection);
            collection.Remove(connection);
            Assert.That(collection.Count, Is.EqualTo(0));
        }
        public void TestWaitForEmptyOnNewCollection()
        {
            var collection = new DummySmtpServerConnectionCollection();

            Assert.True(collection.WaitTillEmpty());
        }