Skip to content

Commit 84fa7ec

Browse files
committed
Merge branch 'feature/41-multi-target'
Also resolves #42
2 parents 305ff8b + e864940 commit 84fa7ec

20 files changed

Lines changed: 160 additions & 394 deletions

.appveyor.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
version: '{branch}-{build}'
2+
image: Visual Studio 2017
3+
4+
init:
5+
- cmd: git config --global core.autocrlf true
6+
7+
install:
8+
- cmd: git submodule update --init --recursive
9+
- cmd: dotnet tool install --global dotnet-sonarscanner
10+
211
before_build:
3-
- cmd: nuget restore CSF.Validation.sln
4-
build:
5-
verbosity: minimal
6-
test:
7-
assemblies:
8-
except:
9-
- '**\Ploeh.AutoFixture.NUnit3.dll'
12+
- cmd: dotnet --version
13+
- cmd: dotnet restore --verbosity m
14+
- cmd: dotnet-sonarscanner begin /k:"CSF.Validation" /v:AppVeyor_build_%APPVEYOR_BUILD_NUMBER% /o:craigfowler-github /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login=%SONARCLOUD_SECRET_KEY% /d:sonar.cs.nunit.reportsPaths=%APPVEYOR_BUILD_FOLDER%\CSF.Validation.Tests\TestResults\TestResults.xml /d:sonar.cs.opencover.reportsPaths=%APPVEYOR_BUILD_FOLDER%\CSF.Validation.Tests\TestResults\coverage.opencover.xml
15+
16+
build_script:
17+
- cmd: dotnet build
18+
19+
test_script:
20+
- cmd: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=\"json,opencover\" /p:CoverletOutput=\"TestResults/\" --test-adapter-path:. --logger:\"nunit\"
21+
22+
after_test:
23+
- cmd: dotnet-sonarscanner end /d:"sonar.login=%SONARCLOUD_SECRET_KEY%"

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ TestResult.formatted.xml
55
*.userprefs
66
*.orig
77
.directory
8-
packages/*/
8+
packages/
99
.vs/

.travis.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
language: csharp
22
solution: CSF.Validation.sln
33

4-
install:
5-
- nuget restore CSF.Validation.sln
6-
- nuget install NUnit.ConsoleRunner -Version 3.6.1 -OutputDirectory testrunner
4+
jobs:
5+
include:
6+
- dotnet: 2.2.207
7+
mono: latest
78

89
script:
9-
- xbuild /p:Configuration=Debug CSF.Validation.sln
10-
- mono "./testrunner/NUnit.ConsoleRunner.3.6.1/tools/nunit3-console.exe" CSF.Validation.Tests/bin/Debug/CSF.Validation.Tests.dll
10+
- dotnet build
11+
- dotnet test

CSF.Validation.Tests/AutoMoqDataAttribute.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2525
// THE SOFTWARE.
2626
using System;
27-
using Ploeh.AutoFixture;
28-
using Ploeh.AutoFixture.AutoMoq;
29-
using Ploeh.AutoFixture.NUnit3;
27+
using AutoFixture;
28+
using AutoFixture.AutoMoq;
29+
using AutoFixture.NUnit3;
3030
namespace CSF.Validation.Tests
3131
{
3232
public class AutoMoqDataAttribute : AutoDataAttribute
3333
{
34-
public AutoMoqDataAttribute() : base(new Fixture().Customize(new AutoMoqCustomization()))
34+
public AutoMoqDataAttribute() : base(() => new Fixture().Customize(new AutoMoqCustomization()))
3535
{
3636
}
3737
}
Lines changed: 26 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,40 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
33
<PropertyGroup>
4-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6-
<ProductVersion>8.0.30703</ProductVersion>
7-
<SchemaVersion>2.0</SchemaVersion>
8-
<ProjectGuid>{11DCF35A-6E2A-4C62-B536-14B83FF5AE07}</ProjectGuid>
9-
<OutputType>Library</OutputType>
10-
<RootNamespace>CSF.Validation.Tests</RootNamespace>
11-
<AssemblyName>CSF.Validation.Tests</AssemblyName>
4+
<TargetFramework>netcoreapp2.2</TargetFramework>
125
<ReleaseVersion>1.0.2</ReleaseVersion>
13-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
146
</PropertyGroup>
15-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16-
<DebugSymbols>true</DebugSymbols>
17-
<DebugType>full</DebugType>
18-
<Optimize>false</Optimize>
19-
<OutputPath>bin\Debug</OutputPath>
20-
<DefineConstants>DEBUG;</DefineConstants>
21-
<ErrorReport>prompt</ErrorReport>
22-
<WarningLevel>4</WarningLevel>
23-
<ConsolePause>false</ConsolePause>
24-
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
25-
</PropertyGroup>
26-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27-
<DebugType>none</DebugType>
28-
<Optimize>false</Optimize>
29-
<OutputPath>bin\Release</OutputPath>
30-
<ErrorReport>prompt</ErrorReport>
31-
<WarningLevel>4</WarningLevel>
32-
<ConsolePause>false</ConsolePause>
33-
</PropertyGroup>
34-
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
7+
8+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
9+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
3510
<ItemGroup>
36-
<Reference Include="CSF.Reflection, Version=1.0.0.0, Culture=neutral, PublicKeyToken=83989bab8a1a4730, processorArchitecture=MSIL">
37-
<HintPath>..\packages\CSF.Reflection.2.0.0\lib\netstandard1.0\CSF.Reflection.dll</HintPath>
38-
</Reference>
39-
<Reference Include="CSF.Specifications, Version=1.0.0.0, Culture=neutral, PublicKeyToken=83989bab8a1a4730, processorArchitecture=MSIL">
40-
<HintPath>..\packages\CSF.Specifications.1.1.0\lib\netstandard1.0\CSF.Specifications.dll</HintPath>
41-
</Reference>
42-
<Reference Include="System" />
43-
<Reference Include="nunit.framework">
44-
<HintPath>..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll</HintPath>
45-
<Package>nunit</Package>
46-
</Reference>
47-
<Reference Include="Castle.Core">
48-
<HintPath>..\packages\Castle.Core.4.0.0\lib\net45\Castle.Core.dll</HintPath>
49-
</Reference>
50-
<Reference Include="Moq">
51-
<HintPath>..\packages\Moq.4.7.8\lib\net45\Moq.dll</HintPath>
52-
</Reference>
53-
<Reference Include="Ploeh.AutoFixture">
54-
<HintPath>..\packages\AutoFixture.3.50.2\lib\net40\Ploeh.AutoFixture.dll</HintPath>
55-
</Reference>
56-
<Reference Include="Ploeh.AutoFixture.NUnit3">
57-
<HintPath>..\packages\AutoFixture.NUnit3.3.50.2\lib\net40\Ploeh.AutoFixture.NUnit3.dll</HintPath>
58-
</Reference>
59-
<Reference Include="Ploeh.AutoFixture.AutoMoq">
60-
<HintPath>..\packages\AutoFixture.AutoMoq.3.50.2\lib\net40\Ploeh.AutoFixture.AutoMoq.dll</HintPath>
61-
</Reference>
62-
<Reference Include="CSF.Utils">
63-
<HintPath>..\packages\CSF.Utils.6.1.1\lib\net45\CSF.Utils.dll</HintPath>
64-
</Reference>
65-
<Reference Include="System.ComponentModel.Composition" />
66-
<Reference Include="System.IO.Compression" />
67-
<Reference Include="System.Net.Http" />
68-
<Reference Include="System.Numerics" />
69-
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
70-
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
71-
</Reference>
72-
<Reference Include="System.Xml" />
73-
<Reference Include="System.Xml.Linq" />
11+
<PackageReference Include="AutoFixture" Version="4.11.0" />
12+
<PackageReference Include="AutoFixture.AutoMoq" Version="4.11.0" />
13+
<PackageReference Include="AutoFixture.NUnit3" Version="4.11.0" />
14+
<PackageReference Include="coverlet.msbuild" Version="2.8.0">
15+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
16+
<PrivateAssets>all</PrivateAssets>
17+
</PackageReference>
18+
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />
19+
<PackageReference Include="NUnit" Version="3.12.0" />
20+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
21+
<PackageReference Include="Moq" Version="4.13.1" />
22+
<PackageReference Include="NunitXml.TestLogger" Version="2.1.41" />
7423
</ItemGroup>
7524
<ItemGroup>
76-
<ProjectReference Include="..\CSF.Validation\CSF.Validation.csproj">
77-
<Project>{C4446BF2-FF24-4C05-893E-0C9E195FBF82}</Project>
78-
<Name>CSF.Validation</Name>
79-
</ProjectReference>
25+
<EmbeddedResource Condition=" '$(EnableDefaultEmbeddedResourceItems)' == 'true' " Update="Resources\FailureMessageTemplates.resx">
26+
<LogicalName>FailureMessageTemplates.resx</LogicalName>
27+
</EmbeddedResource>
8028
</ItemGroup>
81-
<ItemGroup />
8229
<ItemGroup>
83-
<Compile Include="StockRules\NotNullRuleTests.cs" />
84-
<Compile Include="RuleRunner.cs" />
85-
<Compile Include="StockRules\NotNullValueRuleTests.cs" />
86-
<Compile Include="StubValidatedObject.cs" />
87-
<Compile Include="OutcomeAssert.cs" />
88-
<Compile Include="StubRule.cs" />
89-
<Compile Include="ValidationRuns\RunnableRuleTests.cs" />
90-
<Compile Include="ValidationRuns\ValidationRunnerTests.cs" />
91-
<Compile Include="Manifest\DefaultManifestIdentityTests.cs" />
92-
<Compile Include="ValidationRuns\ValidationRunFactoryTests.cs" />
93-
<Compile Include="AutoMoqDataAttribute.cs" />
94-
<Compile Include="Integration\IValidatorCreator.cs" />
95-
<Compile Include="Integration\StringPropertyValidatorCreator.cs" />
96-
<Compile Include="Integration\StringPropertyIntegrationTests.cs" />
97-
<Compile Include="Integration\IntegrationTestBase.cs" />
98-
<Compile Include="Integration\StringAndDecimalPropertyValidatorCreator.cs" />
99-
<Compile Include="Integration\StringAndDecimalPropertyIntegrationTests.cs" />
100-
<Compile Include="Rules\ValueRuleTests.cs" />
101-
<Compile Include="StockRules\NullableNumericRangeValueRuleTests.cs" />
102-
<Compile Include="StockRules\NumericRangeValueRuleTests.cs" />
103-
<Compile Include="StockRules\StringLengthValueRuleTests.cs" />
104-
<Compile Include="StockRules\DateTimeRangeValueRuleTests.cs" />
105-
<Compile Include="StockRules\NullableDateTimeRangeValueRuleTests.cs" />
106-
<Compile Include="StockRules\IsDefinedEnumMemberValueRuleTests.cs" />
107-
<Compile Include="StockRules\NullableIsDefinedEnumMemberValueRuleTests.cs" />
108-
<Compile Include="StockRules\RegexMatchValueRuleTests.cs" />
109-
<Compile Include="Resources\FailureMessageTemplates.cs" />
110-
<Compile Include="Messages\MessageProviderIntegrationTests.cs" />
30+
<Compile Condition=" '$(EnableDefaultCompileItems)' == 'true' " Update="Resources\FailureMessageTemplates.cs">
31+
<DependentUpon>FailureMessageTemplates.resx</DependentUpon>
32+
</Compile>
11133
</ItemGroup>
11234
<ItemGroup>
113-
<None Include="packages.config" />
114-
<None Include="App.config" />
35+
<Folder Include="Resources\" />
11536
</ItemGroup>
11637
<ItemGroup>
117-
<EmbeddedResource Include="Resources\FailureMessageTemplates.resx">
118-
<LastGenOutput>FailureMessages.Designer.cs</LastGenOutput>
119-
</EmbeddedResource>
38+
<ProjectReference Include="..\CSF.Validation\CSF.Validation.csproj" />
12039
</ItemGroup>
12140
</Project>

0 commit comments

Comments
 (0)