Ejemplo n.º 1
0
        internal static FabricWorkerEntryPoint CreateFromAssemblyDescription(DllHostHostedDllDescription hostedDllDescription)
        {
            Debug.Assert(hostedDllDescription.Kind == DllHostHostedDllKind.Managed, "Kind must be ManagedAssembly");

            var assemblyDescription           = (DllHostHostedManagedDllDescription)hostedDllDescription;
            FabricWorkerEntryPoint entryPoint = FabricWorkerEntryPoint.CreateFromAssemblyName(assemblyDescription.AssemblyName);

            entryPoint.assemblyDescription = assemblyDescription;

            return(entryPoint);
        }
            public static void Compare(DllHostHostedDllDescription expected, DllHostHostedDllDescription actual)
            {
                Assert.AreEqual <DllHostHostedDllKind>(expected.Kind, actual.Kind);

                switch (expected.Kind)
                {
                case DllHostHostedDllKind.Managed:
                    Assert.AreEqual <string>(((DllHostHostedManagedDllDescription)expected).AssemblyName, ((DllHostHostedManagedDllDescription)expected).AssemblyName);
                    break;

                case DllHostHostedDllKind.Unmanaged:
                    Assert.AreEqual <string>(((DllHostHostedUnmanagedDllDescription)expected).DllName, ((DllHostHostedUnmanagedDllDescription)expected).DllName);
                    break;

                default:
                    Assert.Fail();
                    break;
                }
            }
 public override DllHostHostedUnmanagedDllDescription Factory(DllHostItemInfo info)
 {
     return(DllHostHostedDllDescription.CreateFromNative(TestUtility.StructureToIntPtr(info.ToNative())) as DllHostHostedUnmanagedDllDescription);
 }