Skip to content

Commit 85914d8

Browse files
committed
Added abstract base class for all convention tests
This will help with other kinds of convention tests, like Windsor tests I'm about to add v. soon.
1 parent f2989ef commit 85914d8

1 file changed

Lines changed: 11 additions & 14 deletions

File tree

ConventionTests/ConventionTests.NUnit.cs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,23 @@ public ConventionData WithApprovedExceptions(string explanation = null)
7373
}
7474
}
7575

76-
/// <summary>
77-
/// Base class for convention tests. Inherited types should be put in "/Conventions" folder in test assembly and follow Sentence_naming_convention_with_underscores_indead_of_spaces These tests will be ran by <see
78-
/// cref="ConventionTestsRunner" /> .
79-
/// </summary>
80-
public abstract class ConventionTest : IConventionTest
76+
public abstract class ConventionTestBase: IConventionTest
8177
{
82-
#region IConventionTest Members
83-
8478
public virtual string Name
8579
{
8680
get { return GetType().Name.Replace('_', ' '); }
8781
}
8882

89-
public virtual void Execute()
83+
public abstract void Execute();
84+
}
85+
86+
/// <summary>
87+
/// Base class for convention tests. Inherited types should be put in "/Conventions" folder in test assembly and follow Sentence_naming_convention_with_underscores_indead_of_spaces These tests will be ran by <see
88+
/// cref="ConventionTestsRunner" /> .
89+
/// </summary>
90+
public abstract class ConventionTest : ConventionTestBase
91+
{
92+
public override void Execute()
9093
{
9194
var data = SetUp();
9295
var typesToTest = GetTypesToTest(data);
@@ -109,8 +112,6 @@ public virtual void Execute()
109112
}
110113
}
111114

112-
#endregion
113-
114115
protected virtual Assembly[] GetAssembliesToScan(ConventionData data)
115116
{
116117
if (data.Assemblies != null)
@@ -153,13 +154,9 @@ public ConventionTestNamer(string name)
153154
this.name = name;
154155
}
155156

156-
#region IApprovalNamer Members
157-
158157
string IApprovalNamer.Name
159158
{
160159
get { return name; }
161160
}
162-
163-
#endregion
164161
}
165162
}

0 commit comments

Comments
 (0)