コード例 #1
0
        public void ForConnectionPool_should_create_expected_message()
        {
            var endPoint = new DnsEndPoint("localhost", 27017);
            var subject  = MongoWaitQueueFullException.ForConnectionPool(endPoint);

            subject.Message.Should().Be("The wait queue for acquiring a connection to server localhost:27017 is full.");
        }
コード例 #2
0
        public void constructor_should_initalize_subject()
        {
            var subject = new MongoWaitQueueFullException("message");

            subject.Message.Should().Be("message");
            subject.InnerException.Should().BeNull();
        }
        public void constructor_should_initalize_subject()
        {
            var subject = new MongoWaitQueueFullException("message");

            subject.Message.Should().Be("message");
            subject.InnerException.Should().BeNull();
        }
        public void Serialization_should_work()
        {
            var subject = new MongoWaitQueueFullException("message");

            var formatter = new BinaryFormatter();
            using (var stream = new MemoryStream())
            {
                formatter.Serialize(stream, subject);
                stream.Position = 0;
                var rehydrated = (MongoWaitQueueFullException)formatter.Deserialize(stream);

                rehydrated.Message.Should().Be(subject.Message);
                rehydrated.InnerException.Should().BeNull();
            }
        }
        public void Serialization_should_work()
        {
            var subject = new MongoWaitQueueFullException("message");

            var formatter = new BinaryFormatter();
            using (var stream = new MemoryStream())
            {
                formatter.Serialize(stream, subject);
                stream.Position = 0;
                var rehydrated = (MongoWaitQueueFullException)formatter.Deserialize(stream);

                rehydrated.Message.Should().Be(subject.Message);
                rehydrated.InnerException.Should().BeNull();
            }
        }
コード例 #6
0
        public void ForServerSelection_should_create_expected_message()
        {
            var subject = MongoWaitQueueFullException.ForServerSelection();

            subject.Message.Should().Be("The wait queue for server selection is full.");
        }