Tuesday, April 15, 2008
So I also made the a similar template with structuremap support included.

Wich looks something like this

Imports Nunit.FrameWork
Imports StructureMap

Namespace $NAMESPACE$
    ''' <summary>
     ''' A TestClass
      ''' </summary>
       ''' <remarks></remarks>
     <TestFixture()> _
     Public Class $CLASSNAME$
    
#Region " Setup and TearDown "
        ''' <summary>
         ''' Sets up the Tests
          ''' </summary>
           ''' <remarks></remarks>
         <Setup()> _
          Public Sub Setup()
                       StructureMapConfiguration.UseDefaultStructureMapConfigFile = False
                   StructureMapConfiguration.ScanAssemblies.IncludeTheCallingAssembly()
            End Sub

        ''' <summary>
         ''' Tears down the test. Is executed after the Test is Completed
          ''' </summary>
           ''' <remarks></remarks>
         <TearDown()> _
          Public Sub TearDown()
                ObjectFactory.ResetDefaults()        
             End Sub      
#End Region     

#Region " Tests "
                   ''' <summary>
         ''' A Test
          ''' </summary>
           ''' <remarks></remarks>
             <Test()> _
              Public Sub $Test_Name$()
           
               End Sub
#End Region

     End Class
End Namespace
And of course I also made an XmlFile so you can easily import it.

NunitTestFixtureWithStructureMapSupport.xml (2,44 KB)
4/15/2008 2:52 PM Romance Daylight Time  #    Disclaimer  |  Comments [0]  |  Trackback