Skip to content

Commit

Permalink
Merge pull request #72 from JakeGinnivan/RemoveDependencies
Browse files Browse the repository at this point in the history
Remove dependencies
  • Loading branch information
JakeGinnivan committed Jan 30, 2016
2 parents 9152ddd + 0ab0339 commit 32e3e42
Show file tree
Hide file tree
Showing 45 changed files with 229 additions and 453 deletions.
3 changes: 2 additions & 1 deletion ConventionTests.sln
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.22823.1
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{AF9054EE-FE89-47A4-9156-BE54A837F2F7}"
ProjectSection(SolutionItems) = preProject
appveyor.yml = appveyor.yml
GitVersionConfig.yaml = GitVersionConfig.yaml
README.md = README.md
EndProjectSection
EndProject
Expand Down
1 change: 1 addition & 0 deletions ConventionTests.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MQ/@EntryIndexedValue">MQ</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
5 changes: 4 additions & 1 deletion GitVersionConfig.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
next-version: 2.3.0
next-version: 3.0.0
branches:
master:
tag: beta
33 changes: 15 additions & 18 deletions Samples/SampleApp.Tests/ProjectConfigurationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,51 @@
{
using System;
using System.IO;
using System.Xml.Linq;
using NSubstitute;
using NUnit.Framework;
using SampleApp.Domain;
using SampleApp.Dtos;
using TestStack.ConventionTests;
using TestStack.ConventionTests.ConventionData;
using TestStack.ConventionTests.Conventions;
using TestStack.ConventionTests.Internal;

[TestFixture]
public class ProjectConfigurationTests
{
IProjectLocator projectLocator;
IProjectProvider projectProvider;
string projectLocation;

[SetUp]
public void Setup()
public ProjectConfigurationTests()
{
projectLocator = Substitute.For<IProjectLocator>();
projectProvider = Substitute.For<IProjectProvider>();
projectProvider
.LoadProjectDocument(Arg.Any<string>())
.Returns(XDocument.Parse(File.ReadAllText(Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, @"..\..\..\SampleApp\SampleApp.csproj")))));
projectLocation = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, @"..\..\..\SampleApp\SampleApp.csproj"));
}

[Test]
public void debug_configurations_should_have_debug_type_pdb_only()
{
Convention.Is(new ConfigurationHasSpecificValue(ConfigurationType.Debug, "DebugType", "full"), new ProjectPropertyGroups(typeof(DomainClass).Assembly, projectProvider, projectLocator));
var configurationHasSpecificValue = new ConfigurationHasSpecificValue(ConfigurationType.Debug, "DebugType", "full");
var projectPropertyGroups = new ProjectPropertyGroups(projectLocation);
Convention.Is(configurationHasSpecificValue, projectPropertyGroups);
}

[Test]
public void debug_configurations_should_have_optimize_false()
{
Convention.Is(new ConfigurationHasSpecificValue(ConfigurationType.Debug, "Optimize", "false"), new ProjectPropertyGroups(typeof(DomainClass).Assembly, projectProvider, projectLocator));
var configurationHasSpecificValue = new ConfigurationHasSpecificValue(ConfigurationType.Debug, "Optimize", "false");
var projectPropertyGroups = new ProjectPropertyGroups(projectLocation);
Convention.Is(configurationHasSpecificValue, projectPropertyGroups);
}

[Test]
public void release_configurations_should_have_debug_type_pdb_only()
{
Convention.Is(new ConfigurationHasSpecificValue(ConfigurationType.Release, "DebugType", "pdbonly"), new ProjectPropertyGroups(typeof(DomainClass).Assembly, projectProvider, projectLocator));
var configurationHasSpecificValue = new ConfigurationHasSpecificValue(ConfigurationType.Release, "DebugType", "pdbonly");
var projectPropertyGroups = new ProjectPropertyGroups(projectLocation);
Convention.Is(configurationHasSpecificValue, projectPropertyGroups);
}

[Test]
public void release_configurations_should_have_optimize_true()
{
Convention.Is(new ConfigurationHasSpecificValue(ConfigurationType.Release, "Optimize", "true"), new ProjectPropertyGroups(typeof(DomainClass).Assembly, projectProvider, projectLocator));
var configurationHasSpecificValue = new ConfigurationHasSpecificValue(ConfigurationType.Release, "Optimize", "true");
var projectPropertyGroups = new ProjectPropertyGroups(projectLocation);
Convention.Is(configurationHasSpecificValue, projectPropertyGroups);
}
}
}
12 changes: 10 additions & 2 deletions Samples/SampleApp.Tests/SqlScriptTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
namespace SampleApp.Tests
{
using System;
using System.IO;
using NUnit.Framework;
using SampleApp.Domain;
using TestStack.ConventionTests;
Expand All @@ -9,11 +11,17 @@
[TestFixture]
public class SqlScriptTests
{
string projectLocation;

public SqlScriptTests()
{
projectLocation = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, @"..\..\..\SampleApp\SampleApp.csproj"));
}

[Test]
[Explicit] // Only works when shadow copy disabled for tests
public void SqlScriptsShouldBeEmbeddedResources()
{
Convention.Is(new FilesAreEmbeddedResources(".sql"), new ProjectFileItems(typeof(DomainClass).Assembly));
Convention.Is(new FilesAreEmbeddedResources(".sql"), new ProjectFileItems(projectLocation));
}
}
}
41 changes: 0 additions & 41 deletions TestStack.ConventionTests.Tests/ConventionAssertionClassTests.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ public void Setup()
public void can_parse_a_normal_project_file_to_read_global_debug_and_release_property_groups()
{
projectProvider
.LoadProjectDocument(Arg.Any<string>())
.LoadProjectDocument()
.Returns(XDocument.Parse(Resources.ProjectFileWithBinReference));

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

Assert.That(projectGroups.PropertyGroups.Length, Is.EqualTo(3));
Assert.That(projectGroups.PropertyGroups.Any(item => item.Debug));
Expand Down
9 changes: 5 additions & 4 deletions TestStack.ConventionTests.Tests/CsvReportTests.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
namespace TestStack.ConventionTests.Tests
{
using System.Linq;
using ApprovalTests.Reporters;
using NUnit.Framework;
using Shouldly;
using TestAssembly.Collections;
using TestStack.ConventionTests.ConventionData;
using TestStack.ConventionTests.Reporting;
using TestStack.ConventionTests.Tests.TestConventions;

[UseReporter(typeof(DiffReporter))]

public class CsvReportTests
{
[Test]
Expand All @@ -17,9 +16,11 @@ public void Can_run_convention_with_simple_reporter()
var typesToVerify = typeof (Leaf).Assembly.GetExportedTypes()
.Where(t => t.Namespace == typeof (Leaf).Namespace);

Convention.IsWithApprovedExeptions(new CollectionsRelationsConvention(),
var failures = Convention.GetFailures(new CollectionsRelationsConvention(),
new Types(typesToVerify, "Entities"),
new CsvReporter());

failures.ShouldMatchApproved();
}
}
}
14 changes: 7 additions & 7 deletions TestStack.ConventionTests.Tests/MvcConventions.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
namespace TestStack.ConventionTests.Tests
{
using ApprovalTests;
using ApprovalTests.Reporters;
using NUnit.Framework;
using Shouldly;
using TestAssembly.Controllers;
using TestStack.ConventionTests.ConventionData;
using TestStack.ConventionTests.Conventions;

[TestFixture]
[UseReporter(typeof(DiffReporter))]
public class MvcConventions
{
[Test]
Expand All @@ -17,8 +15,9 @@ public void controller_conventions()
var types = Types.InAssemblyOf<TestController>();
var convention = new MvcControllerNameAndBaseClassConvention();

var ex = Assert.Throws<ConventionFailedException>(() => Convention.Is(convention, types));
Approvals.Verify(ex.Message);
var failures = Convention.GetFailures(convention, types);

failures.ShouldMatchApproved();
}

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

var ex = Assert.Throws<ConventionFailedException>(() => Convention.Is(convention, types));
Approvals.Verify(ex.Message);
var failures = Convention.GetFailures(convention, types);

failures.ShouldMatchApproved();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'Optimize property in Release|AnyCPU must have a value of true' for 'Project property groups in TestStack.ConventionTests.Tests'
--------------------------------------------------------------------------------------------------------------------------------
'Optimize property in Release|AnyCPU must have a value of true' for 'Project property groups in ProjectName'
------------------------------------------------------------------------------------------------------------

Optimize:false
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
'Platform property in Release|x86 must have a value of AnyCPU' for 'Project property groups in TestStack.ConventionTests.Tests'
-------------------------------------------------------------------------------------------------------------------------------
'Platform property in Global must have a value of AnyCPU' for 'Project property groups in ProjectName'
------------------------------------------------------------------------------------------------------


'Platform property in Release|AnyCPU must have a value of AnyCPU' for 'Project property groups in ProjectName'
--------------------------------------------------------------------------------------------------------------


'Platform property in Release|x86 must have a value of AnyCPU' for 'Project property groups in ProjectName'
-----------------------------------------------------------------------------------------------------------

Platform:x86
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'Project must not reference dlls from bin or obj directories' for 'Project references in TestStack.ConventionTests.Tests'
-------------------------------------------------------------------------------------------------------------------------
'Project must not reference dlls from bin or obj directories' for 'Project references in ProjectName'
-----------------------------------------------------------------------------------------------------

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

bin\Debug\ApprovalTests.dll
Loading

0 comments on commit 32e3e42

Please sign in to comment.