Skip to content

Commit

Permalink
Fixes #159 and brings explicit support for .NET4.6.2 (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielwertheim authored Oct 27, 2021
1 parent b170a21 commit 3312a4c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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();
Expand Down Expand Up @@ -39,7 +39,7 @@ Ensure.That(myString, nameof(myString)).IsNotFishy();

**NOTE:** If you are worried that the constructed `public readonly struct Param<T> {}` 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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion azure-devops/azure-pipelines-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ trigger:
pr: none

pool:
vmImage: ubuntu-latest
vmImage: windows-latest

stages:
- template: stage-build.yml
Expand Down
2 changes: 1 addition & 1 deletion azure-devops/azure-pipelines-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pr:
- master

pool:
vmImage: ubuntu-latest
vmImage: windows-latest

stages:
- template: stage-build.yml
8 changes: 8 additions & 0 deletions azure-devops/stage-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/projects/EnsureThat/EnsureThat.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;net4.6.2;net5.0</TargetFrameworks>
<Title>Ensure.That</Title>
<PackageId>Ensure.That</PackageId>
<PackageTags>ensure-that ensure that argument validation guard clause contracts</PackageTags>
Expand Down
2 changes: 1 addition & 1 deletion src/tests/UnitTests/UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
<TargetFrameworks>net4.6.2;netcoreapp3.1;net5.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
Expand Down

0 comments on commit 3312a4c

Please sign in to comment.