Exemplo n.º 1
0
        public void constructor_with_filename_and_revision_should_initialize_instance()
        {
            var result = new GridFSFileNotFoundException("name", 1);

            result.Message.Should().Contain("filename \"name\"");
            result.Message.Should().Contain("revision 1");
        }
        public void constructor_with_filename_and_revision_should_initialize_instance()
        {
            var result = new GridFSFileNotFoundException("name", 1);

            result.Message.Should().Contain("filename \"name\"");
            result.Message.Should().Contain("revision 1");
        }
Exemplo n.º 3
0
        public void Serialization_should_work()
        {
            var subject = new GridFSFileNotFoundException("filename", 123);

            var formatter = new BinaryFormatter();

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

                rehydrated.Message.Should().Be(subject.Message);
            }
        }
Exemplo n.º 4
0
        public void constructor_with_id_should_initialize_instance()
        {
            var result = new GridFSFileNotFoundException(123);

            result.Message.Should().Contain("id 123");
        }
        public void constructor_with_id_should_initialize_instance()
        {
            var result = new GridFSFileNotFoundException(123);

            result.Message.Should().Contain("id 123");
        }