public void Should_Include_InnerException_Message_In_Message() {
            // Arrange
            var securityException = new SecurityException("Message");

            // Act
            var certificateException = new CertificateException(StoreName.TrustedPeople, StoreLocation.CurrentUser, securityException);

            // Assert
            certificateException.Message.ShouldContain("Message");
        }
        public void Should_Include_Operation_In_Message() {
            // Arrange
            var cryptographicException = new CryptographicException("Message");

            // Act
            var certificateException = new CertificateException("Opperation", StoreName.TrustedPeople, StoreLocation.CurrentUser, cryptographicException);

            // Assert
            certificateException.Message.ShouldContain("Message");
        }
        public void Should_Set_InnerException() {
            // Arrange
            var securityException = new SecurityException("Message");

            // Act
            var certificateException = new CertificateException(StoreName.TrustedPeople, StoreLocation.CurrentUser, securityException);

            // Assert
            certificateException.InnerException.ShouldNotBeNull();
            certificateException.InnerException.ShouldEqual(securityException);
        }
        public void Should_Have_A_Descriptive_Message() {
            // Arrange
            var securityException = new SecurityException("Message");
            var messageRegex = new Regex("Unable to access the (.+) store in the (.+) location: (.+)", RegexOptions.Compiled);

            // Act
            var certificateException = new CertificateException(StoreName.TrustedPeople, StoreLocation.CurrentUser, securityException);

            // Assert
            messageRegex.IsMatch(certificateException.Message).ShouldBeTrue();
        }
        public void Should_Set_InnerException() {
            // Arrange
            var cryptographicException = new CryptographicException("Message");

            // Act
            var certificateException = new CertificateException("Opperation", StoreName.TrustedPeople, StoreLocation.CurrentUser, cryptographicException);

            // Assert
            certificateException.InnerException.ShouldNotBeNull();
            certificateException.InnerException.ShouldEqual(cryptographicException);
        }
        public void Should_Have_A_Descriptive_Message() {
            // Arrange
            var cryptographicException = new CryptographicException("Message");
            var messageRegex = new Regex("A cryptographic error was encountered completing the (.+) operation on the (.+) store in the (.+) location: (.+)", RegexOptions.Compiled);

            // Act
            var certificateException = new CertificateException("Opperation", StoreName.TrustedPeople, StoreLocation.CurrentUser, cryptographicException);

            // Assert
            messageRegex.IsMatch(certificateException.Message).ShouldBeTrue();
        }