public void constructor_should_initalize_subject()
        {
            var subject = new MongoIncompatibleDriverException(_clusterDescription);

            subject.Message.Should().StartWith("Server at localhost:27017 reports wire version 0");
            subject.InnerException.Should().BeNull();
        }
        public void constructor_should_initalize_subject()
        {
            var subject = new MongoIncompatibleDriverException(_clusterDescription);

            subject.Message.StartsWith("This version of the driver is not compatible");
            subject.Message.EndsWith(":" + _clusterDescription.ToString() + ".");
            subject.InnerException.Should().BeNull();
        }
Esempio n. 3
0
        public void constructor_should_initalize_subject()
        {
            var subject = new MongoIncompatibleDriverException(_clusterDescription);

            subject.Message.StartsWith("This version of the driver is not compatible");
            subject.Message.EndsWith(":" + _clusterDescription.ToString() + ".");
            subject.InnerException.Should().BeNull();
        }
        public void Serialization_should_work()
        {
            var subject = new MongoIncompatibleDriverException(_clusterDescription);

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

                rehydrated.Message.Should().Be(subject.Message);
                rehydrated.InnerException.Should().BeNull();
            }
        }
Esempio n. 5
0
        public void Serialization_should_work()
        {
            var subject = new MongoIncompatibleDriverException(_clusterDescription);

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

                rehydrated.Message.Should().Be(subject.Message);
                rehydrated.InnerException.Should().BeNull();
            }
        }