Skip to content

Commit 32e3e42

Browse files
committed
Merge pull request #72 from JakeGinnivan/RemoveDependencies
Remove dependencies
2 parents 9152ddd + 0ab0339 commit 32e3e42

File tree

45 files changed

+229
-453
lines changed

Some content is hidden

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

45 files changed

+229
-453
lines changed

ConventionTests.sln

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 14
4-
VisualStudioVersion = 14.0.22823.1
4+
VisualStudioVersion = 14.0.24720.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{AF9054EE-FE89-47A4-9156-BE54A837F2F7}"
77
ProjectSection(SolutionItems) = preProject
88
appveyor.yml = appveyor.yml
9+
GitVersionConfig.yaml = GitVersionConfig.yaml
910
README.md = README.md
1011
EndProjectSection
1112
EndProject

ConventionTests.sln.DotSettings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MQ/@EntryIndexedValue">MQ</s:String>
1111
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
1212
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
13+
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue">True</s:Boolean>
1314
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
1415
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

GitVersionConfig.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
next-version: 2.3.0
1+
next-version: 3.0.0
2+
branches:
3+
master:
4+
tag: beta

Samples/SampleApp.Tests/ProjectConfigurationTests.cs

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,54 +2,51 @@
22
{
33
using System;
44
using System.IO;
5-
using System.Xml.Linq;
6-
using NSubstitute;
75
using NUnit.Framework;
8-
using SampleApp.Domain;
9-
using SampleApp.Dtos;
106
using TestStack.ConventionTests;
117
using TestStack.ConventionTests.ConventionData;
128
using TestStack.ConventionTests.Conventions;
13-
using TestStack.ConventionTests.Internal;
149

1510
[TestFixture]
1611
public class ProjectConfigurationTests
1712
{
18-
IProjectLocator projectLocator;
19-
IProjectProvider projectProvider;
13+
string projectLocation;
2014

21-
[SetUp]
22-
public void Setup()
15+
public ProjectConfigurationTests()
2316
{
24-
projectLocator = Substitute.For<IProjectLocator>();
25-
projectProvider = Substitute.For<IProjectProvider>();
26-
projectProvider
27-
.LoadProjectDocument(Arg.Any<string>())
28-
.Returns(XDocument.Parse(File.ReadAllText(Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, @"..\..\..\SampleApp\SampleApp.csproj")))));
17+
projectLocation = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, @"..\..\..\SampleApp\SampleApp.csproj"));
2918
}
3019

3120
[Test]
3221
public void debug_configurations_should_have_debug_type_pdb_only()
3322
{
34-
Convention.Is(new ConfigurationHasSpecificValue(ConfigurationType.Debug, "DebugType", "full"), new ProjectPropertyGroups(typeof(DomainClass).Assembly, projectProvider, projectLocator));
23+
var configurationHasSpecificValue = new ConfigurationHasSpecificValue(ConfigurationType.Debug, "DebugType", "full");
24+
var projectPropertyGroups = new ProjectPropertyGroups(projectLocation);
25+
Convention.Is(configurationHasSpecificValue, projectPropertyGroups);
3526
}
3627

3728
[Test]
3829
public void debug_configurations_should_have_optimize_false()
3930
{
40-
Convention.Is(new ConfigurationHasSpecificValue(ConfigurationType.Debug, "Optimize", "false"), new ProjectPropertyGroups(typeof(DomainClass).Assembly, projectProvider, projectLocator));
31+
var configurationHasSpecificValue = new ConfigurationHasSpecificValue(ConfigurationType.Debug, "Optimize", "false");
32+
var projectPropertyGroups = new ProjectPropertyGroups(projectLocation);
33+
Convention.Is(configurationHasSpecificValue, projectPropertyGroups);
4134
}
4235

4336
[Test]
4437
public void release_configurations_should_have_debug_type_pdb_only()
4538
{
46-
Convention.Is(new ConfigurationHasSpecificValue(ConfigurationType.Release, "DebugType", "pdbonly"), new ProjectPropertyGroups(typeof(DomainClass).Assembly, projectProvider, projectLocator));
39+
var configurationHasSpecificValue = new ConfigurationHasSpecificValue(ConfigurationType.Release, "DebugType", "pdbonly");
40+
var projectPropertyGroups = new ProjectPropertyGroups(projectLocation);
41+
Convention.Is(configurationHasSpecificValue, projectPropertyGroups);
4742
}
4843

4944
[Test]
5045
public void release_configurations_should_have_optimize_true()
5146
{
52-
Convention.Is(new ConfigurationHasSpecificValue(ConfigurationType.Release, "Optimize", "true"), new ProjectPropertyGroups(typeof(DomainClass).Assembly, projectProvider, projectLocator));
47+
var configurationHasSpecificValue = new ConfigurationHasSpecificValue(ConfigurationType.Release, "Optimize", "true");
48+
var projectPropertyGroups = new ProjectPropertyGroups(projectLocation);
49+
Convention.Is(configurationHasSpecificValue, projectPropertyGroups);
5350
}
5451
}
5552
}
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
namespace SampleApp.Tests
22
{
3+
using System;
4+
using System.IO;
35
using NUnit.Framework;
46
using SampleApp.Domain;
57
using TestStack.ConventionTests;
@@ -9,11 +11,17 @@
911
[TestFixture]
1012
public class SqlScriptTests
1113
{
14+
string projectLocation;
15+
16+
public SqlScriptTests()
17+
{
18+
projectLocation = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, @"..\..\..\SampleApp\SampleApp.csproj"));
19+
}
20+
1221
[Test]
13-
[Explicit] // Only works when shadow copy disabled for tests
1422
public void SqlScriptsShouldBeEmbeddedResources()
1523
{
16-
Convention.Is(new FilesAreEmbeddedResources(".sql"), new ProjectFileItems(typeof(DomainClass).Assembly));
24+
Convention.Is(new FilesAreEmbeddedResources(".sql"), new ProjectFileItems(projectLocation));
1725
}
1826
}
1927
}

TestStack.ConventionTests.Tests/ConventionAssertionClassTests.cs

Lines changed: 0 additions & 41 deletions
This file was deleted.

TestStack.ConventionTests.Tests/ConventionData/ProjectPropertyGroupsTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ public void Setup()
2323
public void can_parse_a_normal_project_file_to_read_global_debug_and_release_property_groups()
2424
{
2525
projectProvider
26-
.LoadProjectDocument(Arg.Any<string>())
26+
.LoadProjectDocument()
2727
.Returns(XDocument.Parse(Resources.ProjectFileWithBinReference));
2828

29-
var projectGroups = new ProjectPropertyGroups(typeof(ProjectPropertyGroups).Assembly, projectProvider, Substitute.For<IProjectLocator>());
29+
var projectGroups = new ProjectPropertyGroups(projectProvider);
3030

3131
Assert.That(projectGroups.PropertyGroups.Length, Is.EqualTo(3));
3232
Assert.That(projectGroups.PropertyGroups.Any(item => item.Debug));
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
namespace TestStack.ConventionTests.Tests
22
{
33
using System.Linq;
4-
using ApprovalTests.Reporters;
54
using NUnit.Framework;
5+
using Shouldly;
66
using TestAssembly.Collections;
77
using TestStack.ConventionTests.ConventionData;
88
using TestStack.ConventionTests.Reporting;
99
using TestStack.ConventionTests.Tests.TestConventions;
10-
11-
[UseReporter(typeof(DiffReporter))]
10+
1211
public class CsvReportTests
1312
{
1413
[Test]
@@ -17,9 +16,11 @@ public void Can_run_convention_with_simple_reporter()
1716
var typesToVerify = typeof (Leaf).Assembly.GetExportedTypes()
1817
.Where(t => t.Namespace == typeof (Leaf).Namespace);
1918

20-
Convention.IsWithApprovedExeptions(new CollectionsRelationsConvention(),
19+
var failures = Convention.GetFailures(new CollectionsRelationsConvention(),
2120
new Types(typesToVerify, "Entities"),
2221
new CsvReporter());
22+
23+
failures.ShouldMatchApproved();
2324
}
2425
}
2526
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
namespace TestStack.ConventionTests.Tests
22
{
3-
using ApprovalTests;
4-
using ApprovalTests.Reporters;
53
using NUnit.Framework;
4+
using Shouldly;
65
using TestAssembly.Controllers;
76
using TestStack.ConventionTests.ConventionData;
87
using TestStack.ConventionTests.Conventions;
98

109
[TestFixture]
11-
[UseReporter(typeof(DiffReporter))]
1210
public class MvcConventions
1311
{
1412
[Test]
@@ -17,8 +15,9 @@ public void controller_conventions()
1715
var types = Types.InAssemblyOf<TestController>();
1816
var convention = new MvcControllerNameAndBaseClassConvention();
1917

20-
var ex = Assert.Throws<ConventionFailedException>(() => Convention.Is(convention, types));
21-
Approvals.Verify(ex.Message);
18+
var failures = Convention.GetFailures(convention, types);
19+
20+
failures.ShouldMatchApproved();
2221
}
2322

2423
[Test]
@@ -27,8 +26,9 @@ public void api_controller_conventions()
2726
var types = Types.InAssemblyOf<TestController>();
2827
var convention = new ApiControllerNamingAndBaseClassConvention();
2928

30-
var ex = Assert.Throws<ConventionFailedException>(() => Convention.Is(convention, types));
31-
Approvals.Verify(ex.Message);
29+
var failures = Convention.GetFailures(convention, types);
30+
31+
failures.ShouldMatchApproved();
3232
}
3333
}
3434
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'Optimize property in Release|AnyCPU must have a value of true' for 'Project property groups in TestStack.ConventionTests.Tests'
2-
--------------------------------------------------------------------------------------------------------------------------------
1+
'Optimize property in Release|AnyCPU must have a value of true' for 'Project property groups in ProjectName'
2+
------------------------------------------------------------------------------------------------------------
33

44
Optimize:false
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
'Platform property in Release|x86 must have a value of AnyCPU' for 'Project property groups in TestStack.ConventionTests.Tests'
2-
-------------------------------------------------------------------------------------------------------------------------------
1+
'Platform property in Global must have a value of AnyCPU' for 'Project property groups in ProjectName'
2+
------------------------------------------------------------------------------------------------------
3+
4+
5+
'Platform property in Release|AnyCPU must have a value of AnyCPU' for 'Project property groups in ProjectName'
6+
--------------------------------------------------------------------------------------------------------------
7+
8+
9+
'Platform property in Release|x86 must have a value of AnyCPU' for 'Project property groups in ProjectName'
10+
-----------------------------------------------------------------------------------------------------------
311

412
Platform:x86
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'Project must not reference dlls from bin or obj directories' for 'Project references in TestStack.ConventionTests.Tests'
2-
-------------------------------------------------------------------------------------------------------------------------
1+
'Project must not reference dlls from bin or obj directories' for 'Project references in ProjectName'
2+
-----------------------------------------------------------------------------------------------------
33

44
bin\Debug\ApprovalTests.dll
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'Project must not reference dlls from bin or obj directories' for 'Project references in TestStack.ConventionTests.Tests'
2-
-------------------------------------------------------------------------------------------------------------------------
1+
'Project must not reference dlls from bin or obj directories' for 'Project references in ProjectName'
2+
-----------------------------------------------------------------------------------------------------
33

44
bin\Debug\ApprovalTests.dll

0 commit comments

Comments
 (0)