@@ -13,6 +13,7 @@ public class ConventionContext : IConventionResultContext, IConventionFormatCont
1313 readonly IList < IResultsProcessor > processors ;
1414 readonly ITestResultProcessor testResultProcessor ;
1515 readonly IList < ConventionResult > results = new List < ConventionResult > ( ) ;
16+ bool resultSet ;
1617
1718 public ConventionContext ( string dataDescription , IList < IReportDataFormatter > formatters ,
1819 IList < IResultsProcessor > processors , ITestResultProcessor testResultProcessor )
@@ -59,6 +60,7 @@ IReportDataFormatter GetReportDataFormatterFor(object data)
5960
6061 void IConventionResultContext . Is < TResult > ( string resultTitle , IEnumerable < TResult > failingData )
6162 {
63+ resultSet = true ;
6264 // ReSharper disable PossibleMultipleEnumeration
6365 results . Add ( new ConventionResult (
6466 typeof ( TResult ) ,
@@ -71,6 +73,7 @@ void IConventionResultContext.IsSymmetric<TResult>(
7173 string firstSetFailureTitle , IEnumerable < TResult > firstSetFailureData ,
7274 string secondSetFailureTitle , IEnumerable < TResult > secondSetFailureData )
7375 {
76+ resultSet = true ;
7477 results . Add ( new ConventionResult (
7578 typeof ( TResult ) , firstSetFailureTitle ,
7679 dataDescription ,
@@ -103,6 +106,9 @@ public void Execute<TDataSource>(IConvention<TDataSource> convention, TDataSourc
103106 throw new ConventionSourceInvalidException ( String . Format ( "{0} has no data" , data . Description ) ) ;
104107 convention . Execute ( data , this ) ;
105108
109+ if ( ! resultSet )
110+ throw new ResultNotSetException ( "{0} did not set a result, conventions must always set a result" ) ;
111+
106112 foreach ( IResultsProcessor resultsProcessor in processors )
107113 {
108114 resultsProcessor . Process ( this , ConventionResults ) ;
0 commit comments