Skip to content

Commit 9c41696

Browse files
committed
renames, renames everywhere
So we're shifting the balance a bit here. ConventionResult is really becoming a conventionContext which will act as a context object gluing together all various pieces of the pipeline, isolating all the statics etc. Kind of like HttpContext or OperationContext in WCF we're changing the interface to IConventionResultContext. While it's not the best name it's the best I could come up with, without calling it factory (which it's not, since it doesn't return anything) or calling it provider which is just wrong
1 parent faaa40f commit 9c41696

12 files changed

+15
-15
lines changed

TestStack.ConventionTests.Tests/ConventionAssertionClassTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public ConventionReportFailure Format(string failingData)
3333

3434
public class FailingConvention : IConvention<FakeData>
3535
{
36-
public void Execute(FakeData data, IConventionResult result)
36+
public void Execute(FakeData data, IConventionResultContext result)
3737
{
3838
result.Is("Header", new[] {"Different"});
3939
}

TestStack.ConventionTests.Tests/TestConventions/CollectionsRelationsConvention.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class CollectionsRelationsConvention : IConvention<Types>
1010
{
1111
public string ConventionTitle { get; private set; }
1212

13-
public void Execute(Types data, IConventionResult result)
13+
public void Execute(Types data, IConventionResultContext result)
1414
{
1515
ConventionTitle = "well, does the header apply here all across the board? How would that work for CSV?";
1616
var types = data.TypesToVerify;

TestStack.ConventionTests/Conventions/AllClassesHaveDefaultConstructor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
public class AllClassesHaveDefaultConstructor : IConvention<Types>
88
{
9-
public void Execute(Types data, IConventionResult result)
9+
public void Execute(Types data, IConventionResultContext result)
1010
{
1111
result.Is("Types must have a default constructor",
1212
data.TypesToVerify.Where(t => t.HasDefaultConstructor() == false));

TestStack.ConventionTests/Conventions/AllMethodsAreVirtual.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
public class AllMethodsAreVirtual : IConvention<Types>
88
{
9-
public void Execute(Types data, IConventionResult result)
9+
public void Execute(Types data, IConventionResultContext result)
1010
{
1111
result.Is("Methods must be virtual", data.TypesToVerify.SelectMany(t => t.NonVirtualMethods()));
1212
}

TestStack.ConventionTests/Conventions/ClassTypeHasSpecificNamespace.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public ClassTypeHasSpecificNamespace(Func<Type, bool> classIsApplicable, string
3131
this.classType = classType;
3232
}
3333

34-
public void Execute(Types data, IConventionResult result)
34+
public void Execute(Types data, IConventionResultContext result)
3535
{
3636
result.IsSymmetric(
3737
string.Format("{0}s must be under the '{1}' namespace", classType, namespaceToCheck),

TestStack.ConventionTests/Conventions/FilesAreEmbeddedResources.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public FilesAreEmbeddedResources(string fileExtension)
1212

1313
public string FileExtension { get; private set; }
1414

15-
public void Execute(ProjectFiles data, IConventionResult result)
15+
public void Execute(ProjectFiles data, IConventionResultContext result)
1616
{
1717
result.Is(
1818
string.Format("{0} Files must be embedded resources", FileExtension),

TestStack.ConventionTests/Conventions/ProjectDoesNotReferenceDllsFromBinOrObjDirectories.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class ProjectDoesNotReferenceDllsFromBinOrObjDirectories : IConvention<Pr
88
{
99
const string AssemblyReferencingObjRegex = @"^(?<assembly>.*?(obj|bin).*?)$";
1010

11-
public void Execute(ProjectReferences data, IConventionResult result)
11+
public void Execute(ProjectReferences data, IConventionResultContext result)
1212
{
1313
result.Is("Project must not reference dlls from bin or obj directories",
1414
data.References.Where(IsBinOrObjReference));

TestStack.ConventionTests/IConvention.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
{
33
public interface IConvention<in T> where T : IConventionData
44
{
5-
void Execute(T data, IConventionResult result);
5+
void Execute(T data, IConventionResultContext result);
66
}
77
}

TestStack.ConventionTests/IConventionResult.cs renamed to TestStack.ConventionTests/IConventionResultContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using System;
44
using System.Collections.Generic;
55

6-
public interface IConventionResult
6+
public interface IConventionResultContext
77
{
88
void Is<T>(string resultTitle, IEnumerable<T> failingData);
99

TestStack.ConventionTests/Internal/ConventionResult.cs renamed to TestStack.ConventionTests/Internal/ConventionContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
using System.Linq;
66
using TestStack.ConventionTests.Reporting;
77

8-
public class ConventionResult : IConventionResult
8+
public class ConventionContext : IConventionResultContext
99
{
1010
readonly List<ResultInfo> conventionResults;
1111
readonly string dataDescription;
1212
readonly IList<IReportDataFormatter> formatters;
1313

14-
public ConventionResult(string dataDescription, IList<IReportDataFormatter> formatters)
14+
public ConventionContext(string dataDescription, IList<IReportDataFormatter> formatters)
1515
{
1616
this.formatters = formatters;
1717
this.dataDescription = dataDescription;

0 commit comments

Comments
 (0)