I'm preparing a little Reflector Addin to be able to load and execute MbUnit fixtures inside Reflector. Since the fixture tree contains all the functionalities, it was just a matter of injecting it into Reflector.
Screenshot:
The source code is so short that I'm also publishing (note that I'm using the helper classes described here)
using System; using System.Windows.Forms; using Reflector.CodeModel; using MbUnit.Forms; namespace Reflector.Graph.Faulty { // Reflector package public class MbUnitPackage : BasePackage { [ReflectorWindow("MbUnit")] [ReflectorCommandBar(CommandBarTarget.Assembly)] private MbUnitWindow MbUnit=new MbUnitWindow(); } // Tree View public class MbUnitWindow : ReflectorTreeView { private ReflectorServices services =null; public MbUnitWindow() { this.Dock =DockStyle.Fill; } // needed to get reflector current element public ReflectorServices Services { get { return this.services; } set { if (this.services!=null) { this.services.AssemblyBrowser.ActiveItemChanged-=new EventHandler(this.activeItem_Changed); } this.services=value; if (this.services!=null) { this.services.AssemblyBrowser.ActiveItemChanged+=new EventHandler(this.activeItem_Changed); } } } private void activeItem_Changed(Object sender, EventArgs args) { this.RemoveAssemblies(); IAssembly assembly = this.Services.ActiveAssembly; if (assembly!=null) this.Translate(); } // populate tree with current assembly public void Translate() { IAssembly assembly =this.Services.ActiveAssembly; if (assembly==null) return; this.RemoveAssemblies(); this.AddAssembly(assembly.Location); this.ThreadedPopulateTree(); } } }
Page rendered at Thursday, December 04, 2008 9:08:46 AM UTC
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.