コード例 #1
0
        public void Construct_Message_InnerException()
        {
            var innerException = new Exception();
            var exception = new ProjectionException("Message", innerException);

            Assert.That(exception.Message,        Is.EqualTo("Message"));
            Assert.That(exception.InnerException, Is.SameAs(innerException));
        }
コード例 #2
0
        public void Serialization_RoundTrip()
        {
            var exception = new ProjectionException("MessageA", new Exception("MessageB"));
            var formatter = new BinaryFormatter();

            using (var stream = new MemoryStream(512))
            {
                formatter.Serialize(stream, exception);
                stream.Position = 0;
                exception = (ProjectionException) formatter.Deserialize(stream);
            }

            Assert.That(exception,                        Is.Not.Null);
            Assert.That(exception.Message,                Is.EqualTo("MessageA"));
            Assert.That(exception.InnerException,         Is.Not.Null);
            Assert.That(exception.InnerException.Message, Is.EqualTo("MessageB"));
        }
コード例 #3
0
        public void Construct_Message()
        {
            var exception = new ProjectionException("Message");

            Assert.That(exception.Message, Is.EqualTo("Message"));
        }
コード例 #4
0
 public void Construct_Default()
 {
     var exception = new ProjectionException();
 }