source: BMXNET_RPMS_dotNET_UTILITIES-BMX/branch/IHS BMX Framework/lib/NUnit/NUnit-2.5.10.11092/samples/Extensibility/Core/SampleFixtureExtension/SampleFixtureExtensionBuilder.cs@ 1146

Last change on this file since 1146 was 1146, checked in by Sam Habiel, 13 years ago

Initial Import of BMX4

File size: 1.8 KB
Line 
1// ****************************************************************
2// Copyright 2007, Charlie Poole
3// This is free software licensed under the NUnit license. You may
4// obtain a copy of the license at http://nunit.org/?p=license&r=2.4
5// ****************************************************************
6
7using System;
8using NUnit.Core.Builders;
9using NUnit.Core.Extensibility;
10
11namespace NUnit.Core.Extensions
12{
13 /// <summary>
14 /// MockFixtureExtensionBuilder knows how to build
15 /// a MockFixtureExtension.
16 /// </summary>
17 [NUnitAddin(Description="Wraps an NUnitTestFixture with an additional level of SetUp and TearDown")]
18 public class SampleFixtureExtensionBuilder : ISuiteBuilder, IAddin
19 {
20 #region NUnitTestFixtureBuilder Overrides
21 /// <summary>
22 /// Makes a SampleFixtureExtension instance
23 /// </summary>
24 /// <param name="type">The type to be used</param>
25 /// <returns>A SampleFixtureExtension as a TestSuite</returns>
26// protected override TestSuite MakeSuite(Type type)
27// {
28// return new SampleFixtureExtension( type );
29// }
30
31 // The builder recognizes the types that it can use by the presense
32 // of SampleFixtureExtensionAttribute. Note that an attribute does not
33 // have to be used. You can use any arbitrary set of rules that can be
34 // implemented using reflection on the type.
35 public bool CanBuildFrom(Type type)
36 {
37 return Reflect.HasAttribute( type, "NUnit.Core.Extensions.SampleFixtureExtensionAttribute", false );
38 }
39
40 public Test BuildFrom(Type type)
41 {
42 return null;
43 }
44 #endregion
45
46 #region IAddin Members
47 public bool Install(IExtensionHost host)
48 {
49 IExtensionPoint suiteBuilders = host.GetExtensionPoint( "SuiteBuilders" );
50 if ( suiteBuilders == null )
51 return false;
52
53 suiteBuilders.Install( this );
54 return true;
55 }
56 #endregion
57 }
58}
Note: See TracBrowser for help on using the repository browser.