public void InnerExceptionSet()
        {
            var innerException = new Exception();
            var exception      = new PackageException("msg", innerException);

            Assert.Same(innerException, exception.InnerException);
        }
        public void InnerExceptionSet()
        {
            var innerException = new Exception();
            var exception = new PackageException("msg", innerException);

            Assert.AreSame(innerException, exception.InnerException);
        }
        public void IsSerializable()
        {
            var exception = new PackageException();

            using (var stream = new MemoryStream())
            {
                var formatter = new BinaryFormatter();
                formatter.Serialize(stream, exception);

                stream.Position = 0;

                exception = (PackageException)formatter.Deserialize(stream);
            }

            Assert.NotNull(exception);
        }
        public void IsSerializable()
        {
            var exception = new PackageException();

            try
            {
                using (var stream = new MemoryStream())
                {
                    var formatter = new BinaryFormatter();
                    formatter.Serialize(stream, exception);

                    stream.Position = 0;

                    exception = (PackageException)formatter.Deserialize(stream);
                }
            }
            catch (Exception)
            {
                Assert.Fail("Type must be serializable.");
            }

            Assert.IsNotNull(exception, "Type could not be deserialized.");
        }
        public void HasMessage()
        {
            var exception = new PackageException("msg");

            Assert.Equal("msg", exception.Message);
        }
        public void HasMessage()
        {
            var exception = new PackageException("msg");

            Assert.AreEqual("msg", exception.Message);
        }