Skip to content

Commit ab75360

Browse files
committed
overhauled reporting
ConventionResult now holds formatted result and recommended file extension. This will save us from having to have a copy of text renderer in almost any other renderer. Also this gives us flexibility to either use existing result, or overwrite it (or ignore and render your own, but not save it back for validation, like HTML renderer does
1 parent 1347d87 commit ab75360

File tree

28 files changed

+222
-85
lines changed

28 files changed

+222
-85
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
collection,item,can add,can remove
2+
TestAssembly.Collections.Branch,TestAssembly.Collections.Leaf,False,False
3+
TestAssembly.Collections.Forest,TestAssembly.Collections.Tree,True,True
4+
TestAssembly.Collections.Tree,TestAssembly.Collections.Branch,True,False
5+
TestAssembly.Collections.Tree,TestAssembly.Collections.Leaf,False,False

TestStack.ConventionTests.Tests/CsvReportTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55
using NUnit.Framework;
66
using TestAssembly.Collections;
77
using TestStack.ConventionTests.ConventionData;
8+
using TestStack.ConventionTests.Reporting;
89
using TestStack.ConventionTests.Tests.TestConventions;
910

1011
[UseReporter(typeof(DiffReporter))]
1112
public class CsvReportTests
1213
{
1314
[Test]
14-
[Explicit("This is work in progress so ignoring for now")]
1515
public void Can_run_convention_with_simple_reporter()
1616
{
1717
Convention.IsWithApprovedExeptions(new CollectionsRelationsConvention(), new Types("Entities")
1818
{
1919
TypesToVerify =
2020
typeof (Leaf).Assembly.GetExportedTypes()
2121
.Where(t => t.Namespace == typeof (Leaf).Namespace).ToArray()
22-
});
22+
}, new CsvReporter());
2323
}
2424
}
2525
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
'Project must not reference dlls from bin or obj directories' for 'TestStack.ConventionTests.Tests'
22
---------------------------------------------------------------------------------------------------
33

4-
bin\Debug\ApprovalTests.dll
4+
bin\Debug\ApprovalTests.dll
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
'Project must not reference dlls from bin or obj directories' for 'TestStack.ConventionTests.Tests'
22
---------------------------------------------------------------------------------------------------
33

4-
bin\Debug\ApprovalTests.dll
4+
bin\Debug\ApprovalTests.dll
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
'.sql Files must be embedded resources' for 'TestStack.ConventionTests.Tests'
22
-----------------------------------------------------------------------------
33

4-
Scripts\Script2.sql
4+
Scripts\Script2.sql
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
'.sql Files must be embedded resources' for 'TestStack.ConventionTests.Tests'
22
-----------------------------------------------------------------------------
33

4-
Scripts\Script2.sql
4+
Scripts\Script2.sql

TestStack.ConventionTests.Tests/TypeBasedConventions.all_classes_have_default_constructor.approved.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
------------------------------------------------------------------
33

44
TestAssembly.ClassWithNoDefaultCtor
5-
TestAssembly.ClassWithPrivateDefaultCtor
5+
TestAssembly.ClassWithPrivateDefaultCtor

TestStack.ConventionTests.Tests/TypeBasedConventions.all_classes_have_default_constructor_wth_approved_exceptions.approved.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
------------------------------------------------------------------
33

44
TestAssembly.ClassWithNoDefaultCtor
5-
TestAssembly.ClassWithPrivateDefaultCtor
5+
TestAssembly.ClassWithPrivateDefaultCtor
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
'Methods must be virtual' for 'nHibernate Entitites'
22
----------------------------------------------------
33

4-
TestAssembly.SampleDomainClass.TestNonVirtual
4+
TestAssembly.SampleDomainClass.TestNonVirtual
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
'Methods must be virtual' for 'nHibernate Entitites'
22
----------------------------------------------------
33

4-
TestAssembly.SampleDomainClass.TestNonVirtual
4+
TestAssembly.SampleDomainClass.TestNonVirtual

0 commit comments

Comments
 (0)