Skip to content

Commit 53ca0b0

Browse files
committed
made convention data method more descriptive
I still don't like this though... I don't think this sort of behaviour belongs here...
1 parent cc96d70 commit 53ca0b0

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

TestStack.ConventionTests.Tests/ConventionAssertionClassTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public void approval_mismatch()
2121

2222
public class FakeData : IConventionData
2323
{
24-
public void ThrowIfHasInvalidSource()
24+
public void EnsureHasNonEmptySource()
2525
{
2626
}
2727
}

TestStack.ConventionTests/Convention.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public static class Convention
88
{
99
public static void Is<TData>(IConvention<TData> convention, TData data) where TData : IConventionData
1010
{
11-
data.ThrowIfHasInvalidSource();
11+
data.EnsureHasNonEmptySource();
1212
var result = convention.Execute(data);
1313

1414
if (result.Failed)
@@ -17,7 +17,7 @@ public static void Is<TData>(IConvention<TData> convention, TData data) where TD
1717

1818
public static void IsWithApprovedExeptions<TData>(IConvention<TData> convention, TData data) where TData : IConventionData
1919
{
20-
data.ThrowIfHasInvalidSource();
20+
data.EnsureHasNonEmptySource();
2121
var result = convention.Execute(data);
2222

2323
// should we encapsulate Approvals behind Settings?

TestStack.ConventionTests/Conventions/AbstractProjectData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ protected AbstractProjectData(Assembly assembly, IProjectProvider projectProvide
1919

2020
public IProjectProvider ProjectProvider { get; private set; }
2121

22-
public void ThrowIfHasInvalidSource()
22+
public void EnsureHasNonEmptySource()
2323
{
2424
if (ProjectLocator.ResolveProjectFilePath(Assembly) == null)
2525
throw new ConventionSourceInvalidException("Cannot resolve project file for assembly {0}");

TestStack.ConventionTests/Conventions/Types.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class Types : IConventionData
1313

1414
public bool HasApprovedExceptions { get; set; }
1515

16-
public void ThrowIfHasInvalidSource()
16+
public void EnsureHasNonEmptySource()
1717
{
1818
if (ApplicableTypes.None())
1919
throw new ConventionSourceInvalidException("You must supply types to verify");

TestStack.ConventionTests/IConventionData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
{
33
public interface IConventionData
44
{
5-
void ThrowIfHasInvalidSource();
5+
void EnsureHasNonEmptySource();
66
}
77
}

0 commit comments

Comments
 (0)