Esempio n. 1
0
        public static void Ctor_String()
        {
            string message   = "something went wrong";
            var    exception = new Exception(message);

            ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_EXCEPTION, message: message);
        }
Esempio n. 2
0
        public static void Ctor_String()
        {
            string message   = "this is not the key you're looking for";
            var    exception = new KeyNotFoundException(message);

            ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_KEYNOTFOUND, message: message);
        }
        public static void Ctor_Empty()
        {
            var exception = new BadImageFormatException();

            ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_BADIMAGEFORMAT, validateMessage: false);
            Assert.Null(exception.FileName);
        }
        public static void Ctor_String()
        {
            string message   = "this is not the file you're looking for";
            var    exception = new BadImageFormatException(message);

            ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_BADIMAGEFORMAT, message: message);
            Assert.Null(exception.FileName);
        }
        public static void Ctor_String_Exception()
        {
            string message        = "this is not the file you're looking for";
            var    innerException = new Exception("Inner exception");
            var    exception      = new BadImageFormatException(message, innerException);

            ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_BADIMAGEFORMAT, innerException: innerException, message: message);
            Assert.Equal(null, exception.FileName);
        }
Esempio n. 6
0
        public static void Ctor_Empty()
        {
            var exception = new KeyNotFoundException();

            ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_KEYNOTFOUND, validateMessage: false);
        }
Esempio n. 7
0
        public static void Ctor_Empty()
        {
            var exception = new Exception();

            ExceptionUtility.ValidateExceptionProperties(exception, hResult: COR_E_EXCEPTION, validateMessage: false);
        }