コード例 #1
0
        public void constructor_with_messsage_and_innerException_should_initialize_instance()
        {
            var innerException = new Exception();
            var result = new GridFSException("message", innerException);

            result.Message.Should().Be("message");
            result.InnerException.Should().BeSameAs(innerException);
        }
コード例 #2
0
        public void Serialization_should_work()
        {
            var subject = new GridFSException("message", new Exception("inner"));

            var formatter = new BinaryFormatter();

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

                rehydrated.Message.Should().Be(subject.Message);
                rehydrated.InnerException.Message.Should().Be(subject.InnerException.Message);
            }
        }
コード例 #3
0
        public void constructor_with_messsage_should_initialize_instance()
        {
            var result = new GridFSException("message");

            result.Message.Should().Be("message");
        }
コード例 #4
0
        public void constructor_with_messsage_should_initialize_instance()
        {
            var result = new GridFSException("message");

            result.Message.Should().Be("message");
        }