Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 4 additions & 17 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,19 @@
"languageSettings": [
{
"languageId": "csharp",
"words": [
"bazz",
"browsable",
"namespaceanddescendants",
"netcoreapp",
"nologo",
"zyxwvutsrq"
]
"words": ["bazz", "browsable", "nologo", "zyxwvutsrq"]
},
{
"languageId": "csproj",
"words": [
"buildtransitive",
"contentfiles",
"linq",
"ruleset",
"visualstudio"
]
"words": ["buildtransitive", "contentfiles", "linq", "visualstudio"]
},
{
"languageId": "nuspec",
"words": ["netstandard", "schweizer"]
"words": ["schweizer"]
},
{
"languageId": "props",
"words": ["analyzers", "linq", "netstandard"]
"words": ["analyzers", "linq"]
}
],
"overrides": [
Expand Down
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ dotnet_style_require_accessibility_modifiers = for_
file_header_template = unset
indent_size = 4

dotnet_diagnostic.CA1019.severity = suggestion
dotnet_diagnostic.CA1031.severity = suggestion
dotnet_diagnostic.CA1034.severity = none
dotnet_diagnostic.CA1716.severity = suggestion
dotnet_diagnostic.CA1813.severity = suggestion
dotnet_diagnostic.CA2007.severity = none

[*.sh]
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ permissions: {}
jobs:
build:
name: build
runs-on: ubuntu-24.04
strategy:
matrix:
os: [ubuntu-24.04, windows-2022]
runs-on: ${{ matrix.os }}
permissions:
contents: read
packages: write
Expand All @@ -22,7 +25,7 @@ jobs:
- uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4
- run: dotnet run --project targets --no-launch-profile
- name: publish
if: github.event.release != null
if: github.event.release != null && matrix.os == 'windows-2022'
env:
API_KEY: ${{ secrets.NUGET_RAPHA_API_KEY }}
run: dotnet nuget push "**/*.nupkg" --source https://api.nuget.org/v3/index.json --api-key ${{ env.API_KEY }}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.9.303

multi-target .NET 4.7.2 and .NET 8.0

## 2.9.302

add strong name by @thomaslevesque
Expand Down
3 changes: 3 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<Project>

<PropertyGroup>
<SupportedDotnetVersion>net8.0</SupportedDotnetVersion>
<SupportedFrameworkVersion>net472</SupportedFrameworkVersion>
<LatestDotnetVersion>net9.0</LatestDotnetVersion>
<Deterministic>true</Deterministic>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<LangVersion>12.0</LangVersion>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ _[![LambdaTale NuGet version](https://img.shields.io/nuget/v/bbv.LambdaTale?labe
[![Lint](https://github.com/bbvch/LambdaTale/actions/workflows/lint.yml/badge.svg)](https://github.com/bbvch/LambdaTale/actions/workflows/lint.yml)
[![Spell check](https://github.com/bbvch/LambdaTale/actions/workflows/spell-check.yml/badge.svg)](https://github.com/bbvch/LambdaTale/actions/workflows/spell-check.yml)

Platform support: [.NET Standard 2.0 and upwards](https://docs.microsoft.com/en-us/dotnet/standard/net-standard).
Platform support: [.NET 8](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-8) and [.NET 4.7.2](https://learn.microsoft.com/en-us/dotnet/framework/whats-new) upwards.

## Usage

Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<PropertyGroup>
<AnalysisMode>All</AnalysisMode>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>$(SupportedDotnetVersion);$(SupportedFrameworkVersion)</TargetFrameworks>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
</PropertyGroup>
Expand Down
16 changes: 8 additions & 8 deletions src/LambdaTale.Execution/ScenarioInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ public ScenarioInfo(IMethodInfo testMethod, object[] dataRow, string scenarioOut
}

private static ITypeInfo InferTypeArgument(
string typeParameterName, IReadOnlyList<IParameterInfo> parameters, IReadOnlyList<object> passedArguments)
string typeParameterName, List<IParameterInfo> parameters, object[] passedArguments)
{
var sawNullValue = false;
ITypeInfo typeArgument = null;
for (var index = 0; index < Math.Min(parameters.Count, passedArguments.Count); ++index)
for (var index = 0; index < Math.Min(parameters.Count, passedArguments.Length); ++index)
{
var parameterType = parameters[index].ParameterType;
if (parameterType.IsGenericParameter && parameterType.Name == typeParameterName)
Expand All @@ -85,10 +85,10 @@ private static ITypeInfo InferTypeArgument(
}

private static IEnumerable<Argument> GetGeneratedArguments(
IReadOnlyList<ITypeInfo> typeParameters,
IReadOnlyList<ITypeInfo> typeArguments,
IReadOnlyList<IParameterInfo> parameters,
IReadOnlyList<ParameterInfo> parameterInfos,
List<ITypeInfo> typeParameters,
ITypeInfo[] typeArguments,
List<IParameterInfo> parameters,
ParameterInfo[] parameterInfos,
int passedArgumentsCount)
{
for (var missingArgumentIndex = passedArgumentsCount;
Expand Down Expand Up @@ -128,7 +128,7 @@ private static IEnumerable<Argument> GetGeneratedArguments(
private static string GetScenarioDisplayName(
string scenarioOutlineDisplayName,
IReadOnlyList<ITypeInfo> typeArguments,
IReadOnlyList<IParameterInfo> parameters,
List<IParameterInfo> parameters,
IReadOnlyList<Argument> arguments)
{
var typeArgumentsString = typeArguments.Any()
Expand Down Expand Up @@ -158,7 +158,7 @@ private static string GetScenarioDisplayName(
return $"{scenarioOutlineDisplayName}{typeArgumentsString}({string.Join(", ", parameterAndArgumentTokens)})";
}

private class Argument
private sealed class Argument
{
private static readonly MethodInfo genericFactoryMethod = CreateGenericFactoryMethod();

Expand Down
8 changes: 4 additions & 4 deletions src/LambdaTale.Execution/ScenarioInvoker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ await this.timer.AggregateAsync(() =>
}

private async Task<RunSummary> InvokeStepsAsync(
ICollection<IStepDefinition> backGroundStepDefinitions,
List<IStepDefinition> backgroundStepDefinitions,
ICollection<IStepDefinition> scenarioStepDefinitions)
{
var scenarioTypeInfo = this.scenarioClass.GetTypeInfo();
Expand All @@ -191,15 +191,15 @@ private async Task<RunSummary> InvokeStepsAsync(
var scenarioTeardowns = new List<Tuple<StepContext, Func<IStepContext, Task>>>();
var stepNumber = 0;
foreach (var stepDefinition in filters.Aggregate(
backGroundStepDefinitions.Concat(scenarioStepDefinitions),
backgroundStepDefinitions.Concat(scenarioStepDefinitions),
(current, filter) => filter.Filter(current)))
{
stepDefinition.SkipReason ??= skipReason;

var stepDisplayName = GetStepDisplayName(
this.scenario.DisplayName,
++stepNumber,
stepDefinition.DisplayTextFunc?.Invoke(stepDefinition.Text, stepNumber <= backGroundStepDefinitions.Count));
stepDefinition.DisplayTextFunc?.Invoke(stepDefinition.Text, stepNumber <= backgroundStepDefinitions.Count));

var step = new StepTest(this.scenario, stepDisplayName);
this.testOutputHelper.SetScope(step);
Expand Down Expand Up @@ -244,7 +244,7 @@ private async Task<RunSummary> InvokeStepsAsync(
scenarioTeardowns.AddRange(stepTeardowns);
}

if (scenarioTeardowns.Any())
if (scenarioTeardowns.Count != 0)
{
scenarioTeardowns.Reverse();
var teardownTimer = new ExecutionTimer();
Expand Down
2 changes: 1 addition & 1 deletion src/LambdaTale.Execution/ScenarioOutlineTestCaseRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ protected override async Task AfterTestCaseStartingAsync()
}
}

if (!this.scenarioRunners.Any())
if (this.scenarioRunners.Count == 0)
{
var info = new ScenarioInfo(this.TestCase.TestMethod.Method, NoArguments, this.DisplayName);
var test = new Scenario(this.TestCase, info.ScenarioDisplayName);
Expand Down
43 changes: 33 additions & 10 deletions src/LambdaTale.Execution/packages.lock.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,49 @@
{
"version": 2,
"dependencies": {
".NETStandard,Version=v2.0": {
".NETFramework,Version=v4.7.2": {
"MinVer": {
"type": "Direct",
"requested": "[6.0.0, )",
"resolved": "6.0.0",
"contentHash": "+/SsmiySsXJlvQLCGBqaZKNVt3s/Y/HbAdwtop7Km2CnuZbaScoqkWJEBQ5Cy9ebkn6kCYKrHsXgwrFdTgcb3g=="
},
"NETStandard.Library": {
"xunit.extensibility.execution": {
"type": "Direct",
"requested": "[2.0.3, )",
"requested": "[2.9.3, )",
"resolved": "2.9.3",
"contentHash": "yMb6vMESlSrE3Wfj7V6cjQ3S4TXdXpRqYeNEI3zsX31uTsGMJjEw6oD5F5u1cHnMptjhEECnmZSsPxB6ChZHDQ==",
"dependencies": {
"xunit.extensibility.core": "[2.9.3]"
}
},
"xunit.abstractions": {
"type": "Transitive",
"resolved": "2.0.3",
"contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
"contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg=="
},
"lambdatale": {
"type": "Project",
"dependencies": {
"xunit.extensibility.core": "[2.9.3, )"
}
},
"xunit.extensibility.core": {
"type": "CentralTransitive",
"requested": "[2.9.3, )",
"resolved": "2.9.3",
"contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==",
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0"
"xunit.abstractions": "2.0.3"
}
}
},
"net8.0": {
"MinVer": {
"type": "Direct",
"requested": "[6.0.0, )",
"resolved": "6.0.0",
"contentHash": "+/SsmiySsXJlvQLCGBqaZKNVt3s/Y/HbAdwtop7Km2CnuZbaScoqkWJEBQ5Cy9ebkn6kCYKrHsXgwrFdTgcb3g=="
},
"xunit.extensibility.execution": {
"type": "Direct",
Expand All @@ -26,11 +54,6 @@
"xunit.extensibility.core": "[2.9.3]"
}
},
"Microsoft.NETCore.Platforms": {
"type": "Transitive",
"resolved": "1.1.0",
"contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A=="
},
"xunit.abstractions": {
"type": "Transitive",
"resolved": "2.0.3",
Expand Down
2 changes: 1 addition & 1 deletion src/LambdaTale/BackgroundAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ namespace LambdaTale;
public class BackgroundAttribute : Attribute
{
[AttributeUsage(AttributeTargets.Class)]
private class IgnoreXunitAnalyzersRule1013Attribute : Attribute;
private sealed class IgnoreXunitAnalyzersRule1013Attribute : Attribute;
}
2 changes: 2 additions & 0 deletions src/LambdaTale/LambdaTale.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<Target Name="InitializeNuspecProperties" AfterTargets="MinVer">

<ItemGroup>
<NuspecProperty Include="SupportedDotnetVersion=$(SupportedDotnetVersion)" />
<NuspecProperty Include="SupportedFrameworkVersion=$(SupportedFrameworkVersion)" />
<NuspecProperty Include="RepositoryCommit=$(SourceRevisionId)" />
<NuspecProperty Include="RepositoryType=$(RepositoryType)" />
<NuspecProperty Include="RepositoryUrl=$(PrivateRepositoryUrl)" />
Expand Down
23 changes: 17 additions & 6 deletions src/LambdaTale/LambdaTale.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,29 @@
<tags>testing xunit</tags>
<version>$Version$</version>
<dependencies>
<group targetFramework=".NETStandard2.0">
<group targetFramework="$SupportedDotnetVersion$">
<dependency id="xunit.core" version="[2.9.3, 2.10)" />
<dependency id="xunit.extensibility.execution" version="[2.9.3, 2.10)" />
</group>
<group targetFramework="$SupportedFrameworkVersion$">
<dependency id="xunit.core" version="[2.9.3, 2.10)" />
<dependency id="xunit.extensibility.execution" version="[2.9.3, 2.10)" />
</group>
</dependencies>
</metadata>
<files>
<file src="..\..\README.md" target="docs\" />
<file src="bin\Release\netstandard2.0\LambdaTale.dll" target="lib\netstandard2.0" />
<file src="bin\Release\netstandard2.0\LambdaTale.pdb" target="lib\netstandard2.0" />
<file src="bin\Release\netstandard2.0\LambdaTale.xml" target="lib\netstandard2.0" />
<file src="..\LambdaTale.Execution\bin\Release\netstandard2.0\LambdaTale.Execution.dll" target="lib\netstandard2.0" />
<file src="..\LambdaTale.Execution\bin\Release\netstandard2.0\LambdaTale.Execution.pdb" target="lib\netstandard2.0" />

<file src="bin\Release\$SupportedDotnetVersion$\LambdaTale.dll" target="lib\$SupportedDotnetVersion$" />
<file src="bin\Release\$SupportedDotnetVersion$\LambdaTale.pdb" target="lib\$SupportedDotnetVersion$" />
<file src="bin\Release\$SupportedDotnetVersion$\LambdaTale.xml" target="lib\$SupportedDotnetVersion$" />
<file src="..\LambdaTale.Execution\bin\Release\$SupportedDotnetVersion$\LambdaTale.Execution.dll" target="lib\$SupportedDotnetVersion$" />
<file src="..\LambdaTale.Execution\bin\Release\$SupportedDotnetVersion$\LambdaTale.Execution.pdb" target="lib\$SupportedDotnetVersion$" />

<file src="bin\Release\$SupportedFrameworkVersion$\LambdaTale.dll" target="lib\$SupportedFrameworkVersion$" />
<file src="bin\Release\$SupportedFrameworkVersion$\LambdaTale.pdb" target="lib\$SupportedFrameworkVersion$" />
<file src="bin\Release\$SupportedFrameworkVersion$\LambdaTale.xml" target="lib\$SupportedFrameworkVersion$" />
<file src="..\LambdaTale.Execution\bin\Release\$SupportedFrameworkVersion$\LambdaTale.Execution.dll" target="lib\$SupportedFrameworkVersion$" />
<file src="..\LambdaTale.Execution\bin\Release\$SupportedFrameworkVersion$\LambdaTale.Execution.pdb" target="lib\$SupportedFrameworkVersion$" />
</files>
</package>
2 changes: 1 addition & 1 deletion src/LambdaTale/Sdk/StepDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace LambdaTale.Sdk;

internal class StepDefinition : IStepDefinition
internal sealed class StepDefinition : IStepDefinition
{
public string Text { get; set; }

Expand Down
36 changes: 25 additions & 11 deletions src/LambdaTale/packages.lock.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 2,
"dependencies": {
".NETStandard,Version=v2.0": {
".NETFramework,Version=v4.7.2": {
"Microsoft.CodeAnalysis.PublicApiAnalyzers": {
"type": "Direct",
"requested": "[4.14.0, )",
Expand All @@ -14,15 +14,34 @@
"resolved": "6.0.0",
"contentHash": "+/SsmiySsXJlvQLCGBqaZKNVt3s/Y/HbAdwtop7Km2CnuZbaScoqkWJEBQ5Cy9ebkn6kCYKrHsXgwrFdTgcb3g=="
},
"NETStandard.Library": {
"xunit.extensibility.core": {
"type": "Direct",
"requested": "[2.0.3, )",
"resolved": "2.0.3",
"contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
"requested": "[2.9.3, )",
"resolved": "2.9.3",
"contentHash": "kf3si0YTn2a8J8eZNb+zFpwfoyvIrQ7ivNk5ZYA5yuYk1bEtMe4DxJ2CF/qsRgmEnDr7MnW1mxylBaHTZ4qErA==",
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0"
"xunit.abstractions": "2.0.3"
}
},
"xunit.abstractions": {
"type": "Transitive",
"resolved": "2.0.3",
"contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg=="
}
},
"net8.0": {
"Microsoft.CodeAnalysis.PublicApiAnalyzers": {
"type": "Direct",
"requested": "[4.14.0, )",
"resolved": "4.14.0",
"contentHash": "5zBDSa8D1pfn5VyDzRekcYdVx/DGAzwegblVJhzdN0kvPt97TPr12haA6ZG0wS2WgBb1W42GeZJRiRtlNaoY1w=="
},
"MinVer": {
"type": "Direct",
"requested": "[6.0.0, )",
"resolved": "6.0.0",
"contentHash": "+/SsmiySsXJlvQLCGBqaZKNVt3s/Y/HbAdwtop7Km2CnuZbaScoqkWJEBQ5Cy9ebkn6kCYKrHsXgwrFdTgcb3g=="
},
"xunit.extensibility.core": {
"type": "Direct",
"requested": "[2.9.3, )",
Expand All @@ -32,11 +51,6 @@
"xunit.abstractions": "2.0.3"
}
},
"Microsoft.NETCore.Platforms": {
"type": "Transitive",
"resolved": "1.1.0",
"contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A=="
},
"xunit.abstractions": {
"type": "Transitive",
"resolved": "2.0.3",
Expand Down
Loading