29 de Octubre 2003

Configuración de VS + NUnit

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

Posted by rido at 29 de Octubre 2003 a las 10:59 PM
Comments

Commodum ex iniuria sua nemo habere debet - No person ought to have advantage from his own wrong

Posted by: cyber beastiality on 9 de Julio 2004 a las 01:36 AM

Pro bono publico - For the public good

Posted by: beach bikini young nude erotic teen on 13 de Julio 2004 a las 11:37 PM

Pro bono publico - For the public good

Posted by: dirty black trannies on 14 de Julio 2004 a las 02:23 PM

In alio pediculum, in te ricinum non vides - You see a louse on someone else, but not a tick on yourself. (Petronius)

Posted by: men's pantyhose forum on 15 de Julio 2004 a las 07:26 AM

In virtute sunt multi ascensus - In excellence there are many degrees. (Cicero)

Posted by: map on 19 de Julio 2004 a las 10:00 PM

news

Posted by: news- on 1 de Septiembre 2004 a las 02:28 AM

Ad hominem - Appealing to a person's physical and emotional urges, rather than her or his intellect

Posted by: bestiality on 15 de Septiembre 2004 a las 07:32 AM
Post a comment