Skip to content

Commit 9ede640

Browse files
authored
Update package references, refactor code, and fix namespace (#3)
Updated the package references in the csproj files. Refactored the code in several files to improve readability and maintainability. Also, fixed the namespace in the DataTableAssertionExtensions and DataRowAssertionExtensions classes to align with standard conventions. No functional changes were made.
1 parent b464027 commit 9ede640

33 files changed

+81
-167
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ dotnet_diagnostic.RS0030.severity = error
172172
dotnet_diagnostic.IDE0004.severity = error
173173

174174
# IDE0005: Remove unnecessary usings/imports
175-
dotnet_diagnostic.IDE0005.severity = suggestion
175+
dotnet_diagnostic.IDE0005.severity = error
176176

177177
# IDE0051: Remove unused private members (no reads or writes)
178178
dotnet_diagnostic.IDE0051.severity = error

AcceptApiChanges.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
## If your change does change the API on purpose and you double-checked correctness of the changes you can use this script to change the "approved" state of the API
44
## Make sure that you run the approval tests before running this script, because the tests generate *.received.txt files.
55

6-
find Tests/Approval.Tests/ApprovedApi/FluentAssertions.Data/ -type f -name "*received.txt" | perl -pe 'print $_; s/received/verified/' | xargs -n2 mv
6+
find Tests/Approval.Tests/ApprovedApi/FluentAssertions.DataSets/ -type f -name "*received.txt" | perl -pe 'print $_; s/received/verified/' | xargs -n2 mv

Build/Build.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using Nuke.Common;
66
using Nuke.Common.CI.GitHubActions;
77
using Nuke.Common.Execution;
8-
using Nuke.Common.Git;
98
using Nuke.Common.IO;
109
using Nuke.Common.ProjectModel;
1110
using Nuke.Common.Tooling;
@@ -41,8 +40,6 @@ class Build : NukeBuild
4140

4241
string BuildNumber => GitHubActions?.RunNumber.ToString();
4342

44-
string PullRequestBase => GitHubActions?.BaseRef;
45-
4643
[Parameter("Use this parameter if you encounter build problems in any way, " +
4744
"to generate a .binlog file which holds some useful information.")]
4845
readonly bool? GenerateBinLog;
@@ -57,9 +54,6 @@ class Build : NukeBuild
5754
[GitVersion(Framework = "net6.0", NoCache = true, NoFetch = true)]
5855
readonly GitVersion GitVersion;
5956

60-
[GitRepository]
61-
readonly GitRepository GitRepository;
62-
6357
AbsolutePath ArtifactsDirectory => RootDirectory / "Artifacts";
6458

6559
AbsolutePath TestResultsDirectory => RootDirectory / "TestResults";
@@ -148,6 +142,7 @@ class Build : NukeBuild
148142
Target UnitTestsNetFramework => _ => _
149143
.Unlisted()
150144
.DependsOn(Compile)
145+
.OnlyWhenStatic(() => EnvironmentInfo.IsWin)
151146
.Executes(() =>
152147
{
153148
string[] testAssemblies = Projects

Build/_build.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
<PackageDownload Include="xunit.runner.console" Version="[2.5.0]" />
2424
<PackageDownload Include="Node.js.redist" Version="[16.20.0]" />
2525
<PackageReference Include="LibGit2Sharp" Version="0.27.2" />
26-
<PackageReference Include="Nuke.Common" Version="7.0.4" />
27-
<PackageReference Include="Nuke.Components" Version="7.0.4" />
26+
<PackageReference Include="Nuke.Common" Version="7.0.6" />
27+
<PackageReference Include="Nuke.Components" Version="7.0.6" />
2828
<PackageDownload Include="Yarn.MSBuild" Version="[1.22.19]" />
2929
</ItemGroup>
3030
</Project>

Directory.Build.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</PropertyGroup>
1414
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">
1515
<EnableNETAnalyzers>true</EnableNETAnalyzers>
16-
<AnalysisLevel>latest</AnalysisLevel>
16+
<AnalysisLevel>7.0</AnalysisLevel>
1717
<AnalysisMode>All</AnalysisMode>
1818
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
1919
</PropertyGroup>
@@ -26,15 +26,15 @@
2626
<PrivateAssets>all</PrivateAssets>
2727
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2828
</PackageReference>
29-
<PackageReference Include="CSharpGuidelinesAnalyzer" Version="3.8.3">
29+
<PackageReference Include="CSharpGuidelinesAnalyzer" Version="3.8.4">
3030
<PrivateAssets>all</PrivateAssets>
3131
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3232
</PackageReference>
33-
<PackageReference Include="Roslynator.Analyzers" Version="4.3.0">
33+
<PackageReference Include="Roslynator.Analyzers" Version="4.6.1">
3434
<PrivateAssets>all</PrivateAssets>
3535
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3636
</PackageReference>
37-
<PackageReference Include="Meziantou.Analyzer" Version="2.0.70">
37+
<PackageReference Include="Meziantou.Analyzer" Version="2.0.103">
3838
<PrivateAssets>all</PrivateAssets>
3939
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
4040
</PackageReference>

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
[![Coveralls branch](https://img.shields.io/coverallsCoverage/github/fluentassertions/fluentassertions.datasets?branch=develop)](https://coveralls.io/github/fluentassertions/fluentassertions.datasets?branch=develop)
55
[![](https://img.shields.io/github/release/FluentAssertions.Datasets/FluentAssertions.Datasets.svg?label=latest%20release&color=007edf)](https://github.com/FluentAssertions/FluentAssertions.DataSets/releases/latest)
66
[![](https://img.shields.io/nuget/dt/FluentAssertions.DataSets.svg?label=downloads&color=007edf&logo=nuget)](https://www.nuget.org/packages/FluentAssertions.DataSets)
7-
[![](https://img.shields.io/librariesio/dependents/nuget/FluentAssertions.DataSets.svg?label=dependent%20libraries)](https://libraries.io/nuget/FluentAssertions.Data)
7+
[![](https://img.shields.io/librariesio/dependents/nuget/FluentAssertions.DataSets.svg?label=dependent%20libraries)](https://libraries.io/nuget/FluentAssertions.DataSets)
88
[![GitHub Repo stars](https://img.shields.io/github/stars/fluentassertions/fluentassertions.datasets)](https://github.com/fluentassertions/fluentassertions.datasets/stargazers)
99
[![GitHub contributors](https://img.shields.io/github/contributors/fluentassertions/fluentassertions.datasets)](https://github.com/fluentassertions/fluentassertions.datasets/graphs/contributors)
10-
[![GitHub last commit](https://img.shields.io/github/last-commit/fluentassertions/fluentassertions.datasets)](https://github.com/fluentassertions/fluentassertions.data)
11-
[![GitHub commit activity](https://img.shields.io/github/commit-activity/m/fluentassertions/fluentassertions.data)](https://github.com/fluentassertions/fluentassertions.data/graphs/commit-activity)
12-
[![open issues](https://img.shields.io/github/issues/fluentassertions/fluentassertions.data)](https://github.com/fluentassertions/fluentassertions.data/issues)
10+
[![GitHub last commit](https://img.shields.io/github/last-commit/fluentassertions/fluentassertions.datasets)](https://github.com/fluentassertions/fluentassertions.datasets)
11+
[![GitHub commit activity](https://img.shields.io/github/commit-activity/m/fluentassertions/fluentassertions.datasets)](https://github.com/fluentassertions/fluentassertions.datasets/graphs/commit-activity)
12+
[![open issues](https://img.shields.io/github/issues/fluentassertions/fluentassertions.datasets)](https://github.com/fluentassertions/fluentassertions.datasets/issues)
1313
![](https://img.shields.io/badge/release%20strategy-githubflow-orange.svg)
1414

1515
Extends https://www.fluentassertions.com with specialized assertions for dealing with `DataSet`, `DataTable`, `DataRow` and `DataColumn`
1616

1717
> [!WARNING]
18-
> This set of extensions was extracted from Fluent Assertions 6 and is in maintenance mode. Pull Requests will still be accepted, but we will not actively work on improvements or bugs.
18+
> This set of extensions was extracted from Fluent Assertions 6 and is in maintenance mode. Pull Requests will still be accepted, but we will not actively work on improvements or bugs.
1919
2020
# Information
2121
* Uses [Semantic Versioning](https://semver.org/lang/nl/)
@@ -24,7 +24,7 @@ Extends https://www.fluentassertions.com with specialized assertions for dealing
2424

2525
# Installation
2626

27-
This package is shipped as a [NuGet package](https://www.nuget.org/packages/FluentAssertions.Data) and can be installed through the CLI using:
27+
This package is shipped as a [NuGet package](https://www.nuget.org/packages/FluentAssertions.DataSets) and can be installed through the CLI using:
2828

2929
dotnet add package FluentAssertions.DataSets
3030

@@ -33,8 +33,8 @@ This package is shipped as a [NuGet package](https://www.nuget.org/packages/Flue
3333
## Prerequisites
3434

3535
* Visual Studio 2022 or JetBrains Rider 2021.3
36-
* Build Tools 2022 (including the Universal Windows Platform build tools).
37-
* .NET Framework 4.7 SDK
36+
* Build Tools 2022 (including the Universal Windows Platform build tools).
37+
* .NET Framework 4.7 SDK
3838
* .NET 7.0 SDK installed. Check the `global.json`` for the current minimum required version.
3939

4040
## Building

Src/FluentAssertions.DataSets/Common/ReadOnlyNonGenericCollectionWrapper.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.Collections.Generic;
44
using System.Data;
55
using System.Linq;
6-
using FluentAssertions.Common;
76

87
namespace FluentAssertions.DataSets.Common;
98

Src/FluentAssertions.DataSets/DataColumnCollectionAssertionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Data;
33
using System.Linq;
44
using FluentAssertions.Collections;
5-
using FluentAssertions.Common;
5+
using FluentAssertions.DataSets;
66
using FluentAssertions.DataSets.Common;
77
using FluentAssertions.Execution;
88

Src/FluentAssertions.DataSets/DataEquivalencyAssertionOptions.cs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.Data;
44
using System.Linq.Expressions;
55
using System.Reflection;
6-
using FluentAssertions.DataSets.Equivalency;
76
using FluentAssertions.Equivalency;
87

98
namespace FluentAssertions.DataSets;
@@ -127,8 +126,7 @@ private void ExcludeMemberOfSubtypeOfRelatedTypeByGeneratedPredicate<TDeclaringT
127126

128127
private static MemberInfo GetMemberAccessTargetMember(Expression expression)
129128
{
130-
if (expression is UnaryExpression unaryExpression
131-
&& unaryExpression.NodeType == ExpressionType.Convert)
129+
if (expression is UnaryExpression { NodeType: ExpressionType.Convert } unaryExpression)
132130
{
133131
// If the expression is a value type, then accessing it will involve an
134132
// implicit boxing conversion to type object that we need to ignore.
@@ -257,12 +255,7 @@ public bool ShouldExcludeColumn(DataColumn column)
257255
return true;
258256
}
259257

260-
if (excludeColumnNamesByTableName.TryGetValue(column.Table.TableName, out HashSet<string> excludeColumnsForTable)
261-
&& excludeColumnsForTable.Contains(column.ColumnName))
262-
{
263-
return true;
264-
}
265-
266-
return false;
258+
return excludeColumnNamesByTableName.TryGetValue(column.Table.TableName, out HashSet<string> excludeColumnsForTable)
259+
&& excludeColumnsForTable.Contains(column.ColumnName);
267260
}
268261
}

Src/FluentAssertions.DataSets/DataRowAssertionExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using FluentAssertions.DataSets;
44
using JetBrains.Annotations;
55

6+
// ReSharper disable once CheckNamespace
67
namespace FluentAssertions;
78

89
/// <summary>

0 commit comments

Comments
 (0)