public void DefaultConstructorWorks()
        {
            // act
            var exception = new BadWeakActivationConfigException();

            // assert
            Assert.Equal($"Exception of type '{typeof(BadWeakActivationConfigException).FullName}' was thrown.", exception.Message);
            Assert.Null(exception.InnerException);
        }
        public void MessageConstructorWorks()
        {
            // act
            var message   = "Some Message";
            var exception = new BadWeakActivationConfigException(message);

            // assert
            Assert.Equal(message, exception.Message);
            Assert.Null(exception.InnerException);
        }
        public void FullConstructorWorks()
        {
            // act
            var message   = "Some Message";
            var inner     = new InvalidOperationException();
            var exception = new BadWeakActivationConfigException(message, inner);

            // assert
            Assert.Equal(message, exception.Message);
            Assert.Same(inner, exception.InnerException);
        }
        public void SerializationConstructorWorks()
        {
            // arrange
            var message   = "Some Message";
            var inner     = new InvalidOperationException();
            var exception = new BadWeakActivationConfigException(message, inner);

            // act
            var formatter = new BinaryFormatter();

            using var stream = new MemoryStream();

            formatter.Serialize(stream, exception);

            stream.Position = 0;
            var output = formatter.Deserialize(stream);

            // assert
            var other = Assert.IsType <BadWeakActivationConfigException>(output);

            Assert.Equal(message, other.Message);
            Assert.Equal(inner.GetType(), other.InnerException?.GetType());
        }