Exemplo 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);
        }
Exemplo 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);
        }
Exemplo n.º 6
0
        public static void Ctor_Empty()
        {
            var exception = new KeyNotFoundException();

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

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