From 3312a4cb65d50f947bdbf966b72312b23d69b808 Mon Sep 17 00:00:00 2001 From: Daniel Wertheim Date: Wed, 27 Oct 2021 21:10:05 +0200 Subject: [PATCH] Fixes #159 and brings explicit support for .NET4.6.2 (#166) --- README.md | 8 ++++---- azure-devops/azure-pipelines-cd.yml | 2 +- azure-devops/azure-pipelines-ci.yml | 2 +- azure-devops/stage-build.yml | 8 ++++++++ src/projects/EnsureThat/EnsureThat.csproj | 2 +- src/tests/UnitTests/UnitTests.csproj | 2 +- 6 files changed, 16 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 2c68495..66b4bc1 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Ensure.That Ensure.That is a simple guard clause argument validation lib, that helps you with validation of your arguments. -Developed for: .NET5, .NET Standard 2.0 and 2.1 available via [NuGet](https://www.nuget.org/packages/ensure.that/). +Developed for: .NET4.6.2, .NET5.0, .NET Standard 2.0 and 2.1 available via [NuGet](https://www.nuget.org/packages/ensure.that/). [![Build Status](https://dev.azure.com/daniel-wertheim/os/_apis/build/status/Ensure.That-CI?branchName=master)](https://dev.azure.com/daniel-wertheim/os/_build/latest?definitionId=1&branchName=master) [![NuGet](https://img.shields.io/nuget/v/ensure.that.svg)](http://nuget.org/packages/ensure.that) -## Using extension methods +## Ensure.That - Using extension methods ```csharp Ensure.That(myString).IsNotNullOrWhiteSpace(); @@ -39,7 +39,7 @@ Ensure.That(myString, nameof(myString)).IsNotFishy(); **NOTE:** If you are worried that the constructed `public readonly struct Param {}` created for the argument being validated will hurt your performance you can use any of the other constructs e.g. contextual `Ensure.String` or `EnsureArg` (see below for samples). -## Using contextual validation +## Ensure.Context - Using contextual validation Introduced in the `v7.0.0` release. ```csharp @@ -62,7 +62,7 @@ public static class StringArgExtensions Ensure.String.IsNotFishy(myString, nameof(myString)); ``` -### Using static simple methods +### EnsureArg - Using simple static methods Introduced in the `v5.0.0` release. ```csharp diff --git a/azure-devops/azure-pipelines-cd.yml b/azure-devops/azure-pipelines-cd.yml index 211e1eb..0ba2a29 100644 --- a/azure-devops/azure-pipelines-cd.yml +++ b/azure-devops/azure-pipelines-cd.yml @@ -14,7 +14,7 @@ trigger: pr: none pool: - vmImage: ubuntu-latest + vmImage: windows-latest stages: - template: stage-build.yml diff --git a/azure-devops/azure-pipelines-ci.yml b/azure-devops/azure-pipelines-ci.yml index dd69191..97d72e6 100644 --- a/azure-devops/azure-pipelines-ci.yml +++ b/azure-devops/azure-pipelines-ci.yml @@ -19,7 +19,7 @@ pr: - master pool: - vmImage: ubuntu-latest + vmImage: windows-latest stages: - template: stage-build.yml diff --git a/azure-devops/stage-build.yml b/azure-devops/stage-build.yml index 46cd6aa..e033c25 100644 --- a/azure-devops/stage-build.yml +++ b/azure-devops/stage-build.yml @@ -13,6 +13,14 @@ stages: projects: 'src/*.sln' arguments: '-c $(BuildConfiguration) --no-incremental --nologo -p:TreatWarningsAsErrors=true -p:Version=$(SemVer) -p:InformationalVersion=$(CommitId)' + - task: DotNetCoreCLI@2 + displayName: 'UnitTests .Net4.6.2' + inputs: + command: test + projects: 'src/**/UnitTests.csproj' + arguments: '-c $(BuildConfiguration) -f net4.6.2 --no-build' + testRunTitle: 'UnitTests .Net4.6.2' + - task: DotNetCoreCLI@2 displayName: 'UnitTests .NetCoreApp3.1' inputs: diff --git a/src/projects/EnsureThat/EnsureThat.csproj b/src/projects/EnsureThat/EnsureThat.csproj index 62577a2..1855a71 100644 --- a/src/projects/EnsureThat/EnsureThat.csproj +++ b/src/projects/EnsureThat/EnsureThat.csproj @@ -1,7 +1,7 @@ - netstandard2.0;netstandard2.1;net5.0 + netstandard2.0;netstandard2.1;net4.6.2;net5.0 Ensure.That Ensure.That ensure-that ensure that argument validation guard clause contracts diff --git a/src/tests/UnitTests/UnitTests.csproj b/src/tests/UnitTests/UnitTests.csproj index 1642c0d..c15db2f 100644 --- a/src/tests/UnitTests/UnitTests.csproj +++ b/src/tests/UnitTests/UnitTests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;net5.0 + net4.6.2;netcoreapp3.1;net5.0 false true