public void ThenEmbeddedFxShouldNotBeLoadedIntoAppDomain()
            {
                var testNamespace = MethodBase.GetCurrentMethod().DeclaringType.Namespace;
                var testClassName = MethodBase.GetCurrentMethod().Name;

                Action <TestSetup> testSetup = (ts) =>
                {
                    // arrange
                    var testSource               = @"
                    namespace " + testNamespace + @"
                    {
                        using System;

                        public class " + testClassName + @" : MarshalByRefObject
                        {
                        }
                    }";
                    var testEmbeddedResources    = new string[] { };
                    var testReferencedAssemblies = new string[] { "System.dll" };
                    var testBinary               = GivenAnEmbeddedAssemblyLoader.CompileCodeIntoLocation(testSource, testEmbeddedResources, testReferencedAssemblies, new DirectoryInfo(ts.TestAppDomain.BaseDirectory));

                    // act
                    var proxy = ts.TestAppDomain.CreateInstanceFromAndUnwrap(testBinary.FullName, string.Format("{0}.{1}", testNamespace, testClassName));

                    // assert
                    var embeddedFxAssemblyName = AssemblyName.GetAssemblyName(new FileInfo("EmbeddedFx.dll").FullName);
                    GivenAnEmbeddedAssemblyLoader.AssertAppDomainHasLoadedAssemblyName(false, ts.ParentAppDomain, embeddedFxAssemblyName);
                    GivenAnEmbeddedAssemblyLoader.AssertAppDomainHasLoadedAssemblyName(false, ts.TestAppDomain, embeddedFxAssemblyName);
                };

                GivenAnEmbeddedAssemblyLoader.ExecuteTestInsideTestAppDomain(testSetup);
            }
            public void AndRefersToATypeThatIsEmbeddedAsANestedEmbeddedResourceThenEmbeddedResourceAssemblyShouldBeLoadedIntoAppDomain()
            {
                var testNamespace = MethodBase.GetCurrentMethod().DeclaringType.Namespace;
                var testClassName = MethodBase.GetCurrentMethod().Name;

                Action <TestSetup> testSetup = (ts) =>
                {
                    FileInfo nestedLibraryBinary = null;
                    FileInfo libraryBinary       = null;
                    try
                    {
                        // arrange
                        var nestedLibrarySource               = @"
                            namespace " + testNamespace + @"
                            {
                                public class NestedLibraryType
                                {
                                }
                            }";
                        var nestedLibraryEmbeddedResources    = new string[] { };
                        var nestedLibraryReferencedAssemblies = new string[] { };
                        nestedLibraryBinary = GivenAnEmbeddedAssemblyLoader.CompileCodeIntoLocation(nestedLibrarySource, nestedLibraryEmbeddedResources, nestedLibraryReferencedAssemblies, new DirectoryInfo(Path.GetTempPath()));

                        var librarySource               = @"
                            namespace " + testNamespace + @"
                            {
                                public class LibraryType
                                {
                                }
                            }";
                        var libraryEmbeddedResources    = new string[] { nestedLibraryBinary.FullName };
                        var libraryReferencedAssemblies = new string[] { };
                        libraryBinary = GivenAnEmbeddedAssemblyLoader.CompileCodeIntoLocation(librarySource, libraryEmbeddedResources, libraryReferencedAssemblies, new DirectoryInfo(Path.GetTempPath()));

                        var testSource               = @"
                            namespace " + testNamespace + @"
                            {
                                using System;
                                using EmbeddedFx;
 
                                public class " + testClassName + @" : MarshalByRefObject
                                {
                                    static " + testClassName + @"()
                                    {
                                        EmbeddedAssemblyLoader.Register();
                                    }

                                    public " + testClassName + @"()
                                    {
                                        new NestedLibraryType();
                                    }
                                }
                            }";
                        var testEmbeddedResources    = new string[] { libraryBinary.FullName };
                        var testReferencedAssemblies = new string[] { "System.dll", "EmbeddedFx.dll", libraryBinary.FullName, nestedLibraryBinary.FullName };
                        var testBinary               = GivenAnEmbeddedAssemblyLoader.CompileCodeIntoLocation(testSource, testEmbeddedResources, testReferencedAssemblies, new DirectoryInfo(ts.TestAppDomain.BaseDirectory));

                        // act
                        var proxy = ts.TestAppDomain.CreateInstanceFromAndUnwrap(testBinary.FullName, string.Format("{0}.{1}", testNamespace, testClassName));

                        // assert
                        var libraryBinaryAssemblyName = AssemblyName.GetAssemblyName(libraryBinary.FullName);
                        GivenAnEmbeddedAssemblyLoader.AssertAppDomainHasLoadedAssemblyName(false, ts.ParentAppDomain, libraryBinaryAssemblyName);
                        GivenAnEmbeddedAssemblyLoader.AssertAppDomainHasLoadedAssemblyName(false, ts.TestAppDomain, libraryBinaryAssemblyName);

                        var nestedLibraryBinaryAssemblyName = AssemblyName.GetAssemblyName(nestedLibraryBinary.FullName);
                        GivenAnEmbeddedAssemblyLoader.AssertAppDomainHasLoadedAssemblyName(false, ts.ParentAppDomain, nestedLibraryBinaryAssemblyName);
                        GivenAnEmbeddedAssemblyLoader.AssertAppDomainHasLoadedAssemblyName(true, ts.TestAppDomain, nestedLibraryBinaryAssemblyName);
                    }
                    finally
                    {
                        ActOnObject.IfNotNull(libraryBinary, (fi) => fi.Delete());
                        ActOnObject.IfNotNull(nestedLibraryBinary, (fi) => fi.Delete());
                    }
                };

                GivenAnEmbeddedAssemblyLoader.ExecuteTestInsideTestAppDomain(testSetup);
            }