Skip to content

Commit 9fb7126

Browse files
committed
Merge pull request #21 from JakeGinnivan/Reporting
Reporting
2 parents 7408630 + c211004 commit 9fb7126

File tree

46 files changed

+691
-262
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+691
-262
lines changed

ConventionTests.sln.DotSettings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantArgumentNameForLiteralExpression/@EntryIndexedValue">DO_NOT_SHOW</s:String>
23
<s:String x:Key="/Default/CodeStyle/CodeCleanup/Profiles/=all/@EntryIndexedValue">&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;Profile name="all"&gt;&lt;CSArrangeThisQualifier&gt;True&lt;/CSArrangeThisQualifier&gt;&lt;CSRemoveCodeRedundancies&gt;True&lt;/CSRemoveCodeRedundancies&gt;&lt;CSUseAutoProperty&gt;True&lt;/CSUseAutoProperty&gt;&lt;CSMakeFieldReadonly&gt;True&lt;/CSMakeFieldReadonly&gt;&lt;CSUseVar&gt;&lt;BehavourStyle&gt;CAN_CHANGE_TO_IMPLICIT&lt;/BehavourStyle&gt;&lt;LocalVariableStyle&gt;ALWAYS_IMPLICIT&lt;/LocalVariableStyle&gt;&lt;ForeachVariableStyle&gt;ALWAYS_IMPLICIT&lt;/ForeachVariableStyle&gt;&lt;/CSUseVar&gt;&lt;CSOptimizeUsings&gt;&lt;OptimizeUsings&gt;True&lt;/OptimizeUsings&gt;&lt;EmbraceInRegion&gt;False&lt;/EmbraceInRegion&gt;&lt;RegionName&gt;&lt;/RegionName&gt;&lt;/CSOptimizeUsings&gt;&lt;CSShortenReferences&gt;True&lt;/CSShortenReferences&gt;&lt;CSReformatCode&gt;True&lt;/CSReformatCode&gt;&lt;CSharpFormatDocComments&gt;True&lt;/CSharpFormatDocComments&gt;&lt;CSReorderTypeMembers&gt;True&lt;/CSReorderTypeMembers&gt;&lt;/Profile&gt;</s:String>
34
<s:String x:Key="/Default/CodeStyle/CodeCleanup/RecentlyUsedProfile/@EntryValue">all</s:String>
45
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/EXPLICIT_PRIVATE_MODIFIER/@EntryValue">False</s:Boolean>
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
Header
2-
------
1+
Passed: 'Header' for 'Fake data'
2+
--------------------------------
33

4-
Approved Exception
4+
With approved exceptions:
5+
Approved Exception

TestStack.ConventionTests.Tests/ConventionAssertionClassTests.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
namespace TestStack.ConventionTests.Tests
22
{
3+
using System.Collections.Generic;
34
using ApprovalTests.Reporters;
45
using NUnit.Framework;
56
using TestStack.ConventionTests.Internal;
@@ -21,16 +22,22 @@ public void approval_mismatch()
2122

2223
public class FakeData : IConventionData
2324
{
24-
public void EnsureHasNonEmptySource()
25+
public string Description { get { return "Fake data"; } }
26+
27+
public bool HasData { get { return true; } }
28+
29+
public ConventionReportFailure Format(string failingData)
2530
{
31+
return new ConventionReportFailure(failingData);
2632
}
2733
}
2834

2935
public class FailingConvention : IConvention<FakeData>
3036
{
31-
public ConventionResult Execute(FakeData data)
37+
public string ConventionTitle { get { return "Header"; } }
38+
public IEnumerable<object> GetFailingData(FakeData data)
3239
{
33-
return ConventionResult.For(new[] { "" }, "Header", (s, builder) => builder.AppendLine("Different"));
40+
return new[] { "Different" };
3441
}
3542
}
3643
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Some invalid assembly references found in TestStack.ConventionTests.Tests
2-
-------------------------------------------------------------------------
1+
Failed: 'Project must not reference dlls from bin or obj directories' for 'TestStack.ConventionTests.Tests'
2+
-----------------------------------------------------------------------------------------------------------
33

4-
bin\Debug\ApprovalTests.dll
4+
bin\Debug\ApprovalTests.dll
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
Some invalid assembly references found in TestStack.ConventionTests.Tests
2-
-------------------------------------------------------------------------
1+
Passed: 'Project must not reference dlls from bin or obj directories' for 'TestStack.ConventionTests.Tests'
2+
-----------------------------------------------------------------------------------------------------------
33

4-
bin\Debug\ApprovalTests.dll
4+
With approved exceptions:
5+
bin\Debug\ApprovalTests.dll

TestStack.ConventionTests.Tests/ProjectBasedConventions.cs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,8 @@ public void scripts_not_embedded_resources()
5757
.Returns(XDocument.Parse(Resources.ProjectFileWithInvalidSqlScriptFile));
5858

5959
var projectLocator = Substitute.For<IProjectLocator>();
60-
var project = new ProjectFiles(typeof (ProjectBasedConventions).Assembly, projectProvider, projectLocator)
61-
{
62-
Items = i => i.FilePath.EndsWith(".sql")
63-
};
64-
var ex = Assert.Throws<ConventionFailedException>(() => Convention.Is(new FilesAreEmbeddedResources(), project));
60+
var project = new ProjectFiles(typeof (ProjectBasedConventions).Assembly, projectProvider, projectLocator);
61+
var ex = Assert.Throws<ConventionFailedException>(() => Convention.Is(new FilesAreEmbeddedResources(".sql"), project));
6562

6663
Approvals.Verify(ex.Message);
6764
}
@@ -70,15 +67,12 @@ public void scripts_not_embedded_resources()
7067
public void scripts_not_embedded_resources_with_approved_exceptions()
7168
{
7269
var projectLocator = Substitute.For<IProjectLocator>();
73-
var project = new ProjectFiles(typeof(ProjectBasedConventions).Assembly, projectProvider, projectLocator)
74-
{
75-
Items = i => i.FilePath.EndsWith(".sql")
76-
};
70+
var project = new ProjectFiles(typeof (ProjectBasedConventions).Assembly, projectProvider, projectLocator);
7771
projectProvider
7872
.LoadProjectDocument(Arg.Any<string>())
7973
.Returns(XDocument.Parse(Resources.ProjectFileWithInvalidSqlScriptFile));
8074

81-
Convention.IsWithApprovedExeptions(new FilesAreEmbeddedResources(), project);
75+
Convention.IsWithApprovedExeptions(new FilesAreEmbeddedResources(".sql"), project);
8276
}
8377
}
8478
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The following files which should be embedded resources:
2-
-------------------------------------------------------
1+
Failed: '.sql Files must be embedded resources' for 'TestStack.ConventionTests.Tests'
2+
-------------------------------------------------------------------------------------
33

4-
Scripts\Script2.sql
4+
Scripts\Script2.sql
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
The following files which should be embedded resources:
2-
-------------------------------------------------------
1+
Passed: '.sql Files must be embedded resources' for 'TestStack.ConventionTests.Tests'
2+
-------------------------------------------------------------------------------------
33

4-
Scripts\Script2.sql
4+
With approved exceptions:
5+
Scripts\Script2.sql
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
The following types do not have default constructor
2-
---------------------------------------------------
1+
Failed: 'Types must have a default constructor' for 'nHibernate Entitites'
2+
--------------------------------------------------------------------------
33

44
TestAssembly.ClassWithNoDefaultCtor
5-
TestAssembly.ClassWithPrivateDefaultCtor
5+
TestAssembly.ClassWithPrivateDefaultCtor
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
The following types do not have default constructor
2-
---------------------------------------------------
1+
Passed: 'Types must have a default constructor' for 'nHibernate Entitites'
2+
--------------------------------------------------------------------------
33

4+
With approved exceptions:
45
TestAssembly.ClassWithNoDefaultCtor
5-
TestAssembly.ClassWithPrivateDefaultCtor
6+
TestAssembly.ClassWithPrivateDefaultCtor

0 commit comments

Comments
 (0)