public void Init()
        {
            // Create assembly.
            byte[] bytes = UnicodeEncoding.UTF8.GetBytesWithPreamble(GetHighlightingDefinitionXml());
            predefinedManifestResourceStream = new MemoryStream(bytes);
            assembly = new MockAssembly();
            assembly.AddManifestResourceStream("ICSharpCode.Xml.xshd", predefinedManifestResourceStream);

            // Create addins.
            AddIn addIn = AddIn.Load(new StringReader(GetAddInXml()));

            addIn.FileName = @"D:\SharpDevelop\AddIns\MyAddIn.addin";
            addIn.Enabled  = true;

            List <AddIn> addIns = new List <AddIn>();

            addIns.Add(addIn);

            // Create runtimes.
            testRuntime = new DerivedRuntime("MyAddIn.dll", String.Empty, addIns);
            testRuntime.AssemblyFileNames.Add("MyAddIn.dll", assembly);

            unloadedRuntime = new DerivedRuntime("UnLoadedAssembly.dll", String.Empty, addIns);
            unloadedRuntime.AssemblyFileNames.Add("UnLoadedAssembly.dll", null);
            unloadedRuntime.LoadAssemblyFromExceptionToThrow = new FileNotFoundException("UnloadedAssembly.dll not found.");

            List <Runtime> runtimes = new List <Runtime>();

            runtimes.Add(testRuntime);
            runtimes.Add(unloadedRuntime);

            // Create addin highlighting resource.
            highlightingResource = new AddInHighlightingResource(runtimes.ToArray());
        }
 public void Init()
 {
     assembly = new MockAssembly();
     predefinedResourceStream = new MemoryStream();
     assembly.AddManifestResourceStream("ICSharpCode.Test.Xml.xshd", predefinedResourceStream);
 }