Skip to content

Commit bd83605

Browse files
committed
Add benchmarks project and enable central package mgmt
Introduce PropertyFlex.Benchmarks project with initial setup and placeholder benchmark classes. Enable Central Package Management via Directory.Packages.props and update all projects to use it. Disable analyzers and warnings-as-errors for test and benchmark projects. Refactor and expand ValueContainerTests for clarity, coverage, and use of factory methods. Expose internals to test and benchmark projects. Update solution file to include new items.
1 parent 4bb794b commit bd83605

11 files changed

Lines changed: 188 additions & 37 deletions

File tree

Directory.Build.props

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,13 @@
44
<ImplicitUsings>enable</ImplicitUsings>
55
<Nullable>enable</Nullable>
66
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
7+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
78
</PropertyGroup>
9+
<!-- Disable analyzers for test and benchmark projects -->
10+
<PropertyGroup Condition="$(MSBuildProjectName.EndsWith('.Tests')) Or
11+
$(MSBuildProjectName.EndsWith('.Benchmarks'))">
12+
<EnableNETAnalyzers>false</EnableNETAnalyzers>
13+
<EnforceCodeStyleInBuild>false</EnforceCodeStyleInBuild>
14+
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
15+
</PropertyGroup>
816
</Project>

Directory.Packages.props

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project>
2+
<ItemGroup>
3+
<!-- Testing -->
4+
<PackageVersion Include="xunit.v3" Version="1.1.0" />
5+
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.0" />
6+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.0" />
7+
<PackageVersion Include="FluentAssertions" Version="8.3.0" />
8+
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
9+
10+
<!-- Benchmarking -->
11+
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
12+
</ItemGroup>
13+
</Project>

PropertyFlex.slnx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
<Folder Name="/SolutionItems/">
33
<File Path=".editorconfig" />
44
<File Path="Directory.Build.props" />
5+
<File Path="Directory.Packages.props" />
56
</Folder>
7+
<Project Path="benchmarks/PropertyFlex.Benchmarks/PropertyFlex.Benchmarks.csproj" Id="248b2543-a7ee-4d8e-ad80-53595df157ca" />
68
<Project Path="src/PropertyFlex/PropertyFlex.csproj" />
79
<Project Path="tests/PropertyFlex.Tests/PropertyFlex.Tests.csproj" />
810
</Solution>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
namespace PropertyFlex.Benchmarks;
2+
3+
internal sealed class FlexBenchmarks
4+
{
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
namespace PropertyFlex.Benchmarks;
2+
3+
internal sealed class UnionBenchmarks
4+
{
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
namespace PropertyFlex.Benchmarks;
2+
3+
internal sealed class ValueContainerBenchmarks
4+
{
5+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace PropertyFlex.Benchmarks;
2+
3+
internal sealed class Program
4+
{
5+
public static void Main(string[] args)
6+
{
7+
}
8+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<PackageReference Include="BenchmarkDotNet" />
9+
</ItemGroup>
10+
11+
<ItemGroup>
12+
<ProjectReference Include="..\..\src\PropertyFlex\PropertyFlex.csproj" />
13+
</ItemGroup>
14+
15+
</Project>

src/PropertyFlex/PropertyFlex.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,9 @@
44
<DefaultNamespace>PropertyFlexLib</DefaultNamespace>
55
</PropertyGroup>
66

7+
<ItemGroup>
8+
<InternalsVisibleTo Include="PropertyFlex.Tests" />
9+
<InternalsVisibleTo Include="PropertyFlex.Benchmarks" />
10+
</ItemGroup>
11+
712
</Project>

tests/PropertyFlex.Tests/PropertyFlex.Tests.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@
1010

1111
<ItemGroup>
1212
<!-- XUnit v3 - Latest version with modern features -->
13-
<PackageReference Include="xunit.v3" Version="1.*" />
14-
<PackageReference Include="xunit.runner.visualstudio" Version="3.*">
13+
<PackageReference Include="xunit.v3" />
14+
<PackageReference Include="xunit.runner.visualstudio">
1515
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1616
<PrivateAssets>all</PrivateAssets>
1717
</PackageReference>
1818

1919
<!-- Required for running tests -->
20-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
20+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
2121

2222
<!-- FluentAssertions for more readable and expressive assertions -->
23-
<PackageReference Include="FluentAssertions" Version="8.*" />
23+
<PackageReference Include="FluentAssertions" />
2424

2525
<!-- Coverlet for code coverage -->
26-
<PackageReference Include="coverlet.collector" Version="6.*">
26+
<PackageReference Include="coverlet.collector">
2727
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2828
<PrivateAssets>all</PrivateAssets>
2929
</PackageReference>

0 commit comments

Comments
 (0)