Hoy he vuelto a intentar la macro, sigue dando problemas,
el UI no es útil, y hacerlo bien me va a llevar tiempo asi que lo
necesito es algo ... "quick and dirty".
Paso de UI, y con unas ctes me apaño, de paso hago
un poco de Refactoring y para terminar lo dejo todo en un ficherito como este..
'--------------------------------------------------------------
'written by rido'03 (rido@ya.com)
'------------------------------------------------------------
Imports System
Imports EnvDTE
Imports System.Diagnostics
Imports VSLangProj
#Region "Path to NUnit"
Public Module NUnitConstants
Public Const BASE_PATH As String = "c:\Program Files\NUnit v2.1\bin\"
Public Const NUNIT_FX_ID As String = "nunit.framework.dll"
Public Const NUNIT_FX As String = BASE_PATH & "nunit.framework.dll"
Public Const NUNITGUI_RUNNER As String = BASE_PATH & "nunit-gui.exe"
End Module
#End Region
Public Module TestProjectConfigurator
Dim currentProject As VSProject
#Region "Private"
Private Sub removeReference(ByVal referenceIdentity As String)
currentProject.References.Find(referenceIdentity).Remove()
End Sub
Private Sub addReference(ByVal referencePath As String)
currentProject.References.Add(referencePath)
End Sub
Private Sub resetDebugProperties()
Dim configProps As Properties = currentProject.Project.ConfigurationManager.ActiveConfiguration.Properties
With configProps
.Item("StartAction").Value = prjStartAction.prjStartActionProject
.Item("StartProgram").Value = ""
.Item("StartArguments").Value = ""
End With
End Sub
Private Sub setDebugProperties(ByVal runnerPath As String)
Dim assemblyName As EnvDTE.Property = CType(currentProject.Project.Properties.Item("AssemblyName"), EnvDTE.Property)
Dim configProps As Properties = currentProject.Project.ConfigurationManager.ActiveConfiguration.Properties
With configProps
.Item("StartAction").Value = prjStartAction.prjStartActionProgram
.Item("StartProgram").Value = runnerPath
.Item("StartArguments").Value = assemblyName.Value + ".dll"
End With
End Sub
Private Sub resetProject()
removeReference(NUNIT_FX_ID)
resetDebugProperties()
End Sub
Private Sub configureProject()
addReference(NUNIT_FX)
setDebugProperties(NUNITGUI_RUNNER)
End Sub
#End Region
Public Sub Run()
currentProject = DTE.ActiveSolutionProjects(0).Object
configureProject()
End Sub
Public Sub ResetConfig(ByVal nada As Object)
currentProject = DTE.ActiveSolutionProjects(0).Object
resetProject()
End Sub
End Module
Commodum ex iniuria sua nemo habere debet - No person ought to have advantage from his own wrong
Pro bono publico - For the public good
Pro bono publico - For the public good
In alio pediculum, in te ricinum non vides - You see a louse on someone else, but not a tick on yourself. (Petronius)
In virtute sunt multi ascensus - In excellence there are many degrees. (Cicero)
news
Posted by: news- on 1 de Septiembre 2004 a las 02:28 AMAd hominem - Appealing to a person's physical and emotional urges, rather than her or his intellect