GetRuntimeInterfaceAsObject() public static method

public static GetRuntimeInterfaceAsObject ( System.Guid clsid, System.Guid riid ) : object
clsid System.Guid
riid System.Guid
return object
コード例 #1
0
        public static void RuntimeEnvironmentNegTest()
        {
            Type     clsType = typeof(RuntimeEnvironmentTest);
            Assembly assem   = clsType.Assembly;

            Assert.True(!RuntimeEnvironment.FromGlobalAccessCache(assem));

            Assert.Throws <PlatformNotSupportedException>(() => RuntimeEnvironment.SystemConfigurationFile);

            Guid guid;

            Assert.Throws <PlatformNotSupportedException>(() => RuntimeEnvironment.GetRuntimeInterfaceAsObject(guid, guid));
            Assert.Throws <PlatformNotSupportedException>(() => RuntimeEnvironment.GetRuntimeInterfaceAsIntPtr(guid, guid));
        }
コード例 #2
0
 public void GetRuntimeInterfaceAsObject_Invoke_ThrowsPlatformNotSupportedException()
 {
     Assert.Throws <PlatformNotSupportedException>(() => RuntimeEnvironment.GetRuntimeInterfaceAsObject(Guid.Empty, Guid.Empty));
 }
コード例 #3
0
        public void GetRuntimeInterfaceAsObject_Invoke_ThrowsPlatformNotSupportedException()
        {
#pragma warning disable 618 // GetRuntimeInterfaceAsObject is marked as Obsolete
            Assert.Throws <PlatformNotSupportedException>(() => RuntimeEnvironment.GetRuntimeInterfaceAsObject(Guid.Empty, Guid.Empty));
#pragma warning restore 618
        }