コード例 #1
0
        static unsafe MonoObject *CreateException(ExceptionType type, IntPtr arg0)
        {
            Exception rv   = null;
            var       str0 = Marshal.PtrToStringAuto(arg0);

            switch (type)
            {
            case ExceptionType.System_Exception:
                rv = new System.Exception(str0);
                break;

            case ExceptionType.System_InvalidCastException:
                rv = new System.InvalidCastException(str0);
                break;

            case ExceptionType.System_EntryPointNotFoundException:
                rv = new System.EntryPointNotFoundException(str0);
                break;

            case ExceptionType.System_OutOfMemoryException:
                rv = new System.OutOfMemoryException();
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(type));
            }

            return((MonoObject *)GetMonoObject(rv));
        }
コード例 #2
0
 public static void Ctor_String()
 {
     string message = "Created EntryPointNotFoundException";
     var exception = new EntryPointNotFoundException(message);
     Assert.Equal(message, exception.Message);
     Assert.Equal(COR_E_ENTRYPOINTNOTFOUND, exception.HResult);
 }
コード例 #3
0
 public static void Ctor_Empty()
 {
     var exception = new EntryPointNotFoundException();
     Assert.NotNull(exception);
     Assert.NotEmpty(exception.Message);
     Assert.NotNull(exception.ToString());
     Assert.Equal(COR_E_ENTRYPOINTNOTFOUND, exception.HResult);
 }
コード例 #4
0
        public static void Ctor_String_Exception()
        {
            string message = "Created EntryPointNotFoundException";
            var innerException = new Exception("Created inner exception");
            var exception = new EntryPointNotFoundException(message, innerException);

            Assert.Equal(message, exception.Message);
            Assert.Equal(exception.GetBaseException().Message, "Created inner exception");
            Assert.Equal(COR_E_ENTRYPOINTNOTFOUND, exception.HResult);
            Assert.Equal(innerException, exception.InnerException);
            Assert.Equal(innerException.HResult, exception.InnerException.HResult);
        }
コード例 #5
0
ファイル: UnitTestApi.cs プロジェクト: CSharpDev/Dev.All
        public void MyTestMethod()
        {
            EntryPointNotFoundException entryPointNotFoundException = new EntryPointNotFoundException();

            StringBuilder builder = new StringBuilder();

            builder.ToString().Split(",".ToCharArray());

            var fileName = "";
            Stream stream = new FileStream(fileName, FileMode.Open);
            StreamReader reader = new StreamReader(stream);
            EntryPointNotFoundException exception = new EntryPointNotFoundException(fileName);


            Stream inputStream = File.OpenRead(fileName);

       





        }