Skip to content

Commit 655911c

Browse files
authored
Merge pull request #2 from thomhurst/feature/tunit-support
TUnit Support
2 parents 507dc28 + ee61f05 commit 655911c

File tree

175 files changed

+7456
-59
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+7456
-59
lines changed

.editorconfig

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
root = true
22

3-
[*.{cs,fs,fsx}]
4-
indent_size = 4
5-
indent_style = space
6-
73
[*.{sln,csproj,fsproj,config,xml,props}]
84
indent_size = 2
95
indent_style = space
106

117
[*.cs]
8+
indent_size = 4
9+
indent_style = space
10+
1211
# Require "this." keyword qualification in code
1312
dotnet_style_qualification_for_field = true:suggestion
1413
dotnet_style_qualification_for_property = true:suggestion
1514
dotnet_style_qualification_for_method = true:suggestion
1615
dotnet_style_qualification_for_event = true:suggestion
16+
17+
dotnet_diagnostic.CA1510.severity = suggestion
18+
dotnet_diagnostic.CA1859.severity = suggestion

.nuke/build.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
},
131131
"Solution": {
132132
"type": "string",
133-
"description": "Path to a solution file that is automatically loaded"
133+
"description": "Path to a solution file that is automatically loaded. Default is AutoFixture.TUnit.sln"
134134
}
135135
}
136136
},
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ dotnet_diagnostic.CA5394.severity = none # CA5394: Do not use insecure randomnes
2626

2727
## StyleCop Analyzers ##
2828

29+
dotnet_diagnostic.SA1101.severity = none # SA1101: Prefix local calls with this.
2930
dotnet_diagnostic.SA1116.severity = none # SA1116: The parameters should begin on the line after the declaration, whenever the parameter span across multiple line
3031
dotnet_diagnostic.SA1117.severity = none # SA1117: The parameters should all be placed on the same line or each parameter should be placed on its own line.
3132
dotnet_diagnostic.SA1118.severity = none # SA1118: The parameter spans multiple lines
@@ -35,6 +36,7 @@ dotnet_diagnostic.SA1202.severity = none # SA1202: 'public' members should come
3536
dotnet_diagnostic.SA1203.severity = none # SA1203: Constant fields should appear before non-constant fields
3637
dotnet_diagnostic.SA1204.severity = none # SA1204: Static members should appear before non-static members
3738
dotnet_diagnostic.SA1214.severity = none # SA1214: Readonly fields should appear before non-readonly fields
39+
dotnet_diagnostic.SA1309.severity = none # SA1309: Field names should not begin with an underscore
3840
dotnet_diagnostic.SA1413.severity = none # SA1413: Use trailing comma in multi-line initializers
3941
dotnet_diagnostic.SA1501.severity = none # SA1501: Statement should not be on a single line
4042
dotnet_diagnostic.SA1503.severity = none # SA1503: Braces should not be omitted

AutoFixture.TUnit.sln

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1717
Common.props = Common.props
1818
Common.Test.props = Common.Test.props
1919
LICENCE.txt = LICENCE.txt
20+
AutoFixture.TUnit.globalconfig = AutoFixture.TUnit.globalconfig
21+
AutoFixture.TUnit.sln.DotSettings = AutoFixture.TUnit.sln.DotSettings
22+
AutoFixture.TUnit.Tests.globalconfig = AutoFixture.TUnit.Tests.globalconfig
2023
EndProjectSection
2124
EndProject
25+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestTypeFoundation", "tests\TestTypeFoundation\TestTypeFoundation.csproj", "{5F812210-5B61-4CBF-A033-4C33067A5DE9}"
26+
EndProject
2227
Global
2328
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2429
Debug|Any CPU = Debug|Any CPU
@@ -41,6 +46,12 @@ Global
4146
{4056BD12-5FA8-4D2E-274A-7E85E858A5FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4247
{4056BD12-5FA8-4D2E-274A-7E85E858A5FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
4348
{4056BD12-5FA8-4D2E-274A-7E85E858A5FC}.Verify|Any CPU.ActiveCfg = Verify|Any CPU
49+
{5F812210-5B61-4CBF-A033-4C33067A5DE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
50+
{5F812210-5B61-4CBF-A033-4C33067A5DE9}.Debug|Any CPU.Build.0 = Debug|Any CPU
51+
{5F812210-5B61-4CBF-A033-4C33067A5DE9}.Release|Any CPU.ActiveCfg = Release|Any CPU
52+
{5F812210-5B61-4CBF-A033-4C33067A5DE9}.Release|Any CPU.Build.0 = Release|Any CPU
53+
{5F812210-5B61-4CBF-A033-4C33067A5DE9}.Verify|Any CPU.ActiveCfg = Verify|Any CPU
54+
{5F812210-5B61-4CBF-A033-4C33067A5DE9}.Verify|Any CPU.Build.0 = Verify|Any CPU
4455
EndGlobalSection
4556
GlobalSection(SolutionProperties) = preSolution
4657
HideSolutionNode = FALSE

Common.Test.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@
3434
</ItemGroup>
3535

3636
<ItemGroup>
37-
<GlobalAnalyzerConfigFiles Include="$(MSBuildThisFileDirectory)/AutoFixture.Tests.globalconfig" />
37+
<GlobalAnalyzerConfigFiles Include="$(MSBuildThisFileDirectory)/AutoFixture.TUnit.Tests.globalconfig" />
3838
</ItemGroup>
3939
</Project>

Common.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</PropertyGroup>
3939

4040
<ItemGroup>
41-
<GlobalAnalyzerConfigFiles Include="$(MSBuildThisFileDirectory)/AutoFixture.globalconfig" />
41+
<GlobalAnalyzerConfigFiles Include="$(MSBuildThisFileDirectory)/AutoFixture.TUnit.globalconfig" />
4242
</ItemGroup>
4343

4444
<ItemGroup>

build/.editorconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ csharp_style_expression_bodied_methods = true:silent
99
csharp_style_expression_bodied_properties = true:warning
1010
csharp_style_expression_bodied_indexers = true:warning
1111
csharp_style_expression_bodied_accessors = true:warning
12+
13+
dotnet_naming_style.field_style.capitalization = pascal_case

build/Build.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@
2020
"continuous",
2121
GitHubActionsImage.WindowsLatest,
2222
AutoGenerate = false,
23-
OnPullRequestBranches = new[] { MasterBranch, ReleaseBranch },
23+
OnPullRequestBranches = [MasterBranch, ReleaseBranch],
2424
PublishArtifacts = false,
25-
InvokedTargets = new[] { nameof(Verify), nameof(Cover), nameof(Pack) },
25+
InvokedTargets = [nameof(Verify), nameof(Cover), nameof(Pack)],
2626
EnableGitHubToken = true)]
2727
[GitHubActions(
2828
"release",
2929
GitHubActionsImage.WindowsLatest,
3030
AutoGenerate = false,
31-
OnPushTags = new[] { "v*" },
31+
OnPushTags = ["v*"],
3232
PublishArtifacts = true,
33-
InvokedTargets = new[] { nameof(Verify), nameof(Cover), nameof(Publish) },
33+
InvokedTargets = [nameof(Verify), nameof(Cover), nameof(Publish)],
3434
EnableGitHubToken = true,
35-
ImportSecrets = new[] { Secrets.NuGetApiKey })]
36-
partial class Build : NukeBuild
35+
ImportSecrets = [Secrets.NuGetApiKey])]
36+
class Build : NukeBuild
3737
{
3838
public static int Main() => Execute<Build>(x => x.Compile);
3939

@@ -43,22 +43,22 @@ partial class Build : NukeBuild
4343
[Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
4444
readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;
4545

46-
[Solution] readonly Solution Solution;
46+
[Solution("AutoFixture.TUnit.sln")] readonly Solution Solution;
4747
[GitRepository] readonly GitRepository GitRepository;
4848
[GitVersion] readonly GitVersion GitVersion;
4949
[CI] readonly GitHubActions GitHubActions;
5050

5151
[Parameter("GitHub auth token", Name = "github-token"), Secret] readonly string GitHubToken;
5252
[Parameter("Forces the continuous integration build flag")] readonly bool CI;
5353

54-
[Secret] [Parameter("NuGet API Key (secret)", Name = Secrets.NuGetApiKey)] readonly string NuGetApiKey;
54+
[Secret][Parameter("NuGet API Key (secret)", Name = Secrets.NuGetApiKey)] readonly string NuGetApiKey;
5555
readonly string NuGetSource = "https://api.nuget.org/v3/index.json";
5656

57-
IEnumerable<Project> Excluded => new[]
58-
{
57+
IEnumerable<Project> Excluded =>
58+
[
5959
Solution.GetProject("_build"),
6060
Solution.GetProject("TestTypeFoundation")
61-
};
61+
];
6262

6363
IEnumerable<Project> TestProjects => Solution.GetAllProjects("*Tests");
6464
IEnumerable<Project> Libraries => Solution.Projects.Except(TestProjects).Except(Excluded);
@@ -147,7 +147,7 @@ partial class Build : NukeBuild
147147
.Executes(() =>
148148
{
149149
ReportGenerator(_ => _
150-
.SetFramework("net5.0")
150+
.SetFramework("net8.0")
151151
.SetAssemblyFilters("-TestTypeFoundation*")
152152
.SetReports(TestResultsDirectory / "**" / "coverage.cobertura.xml")
153153
.SetTargetDirectory(ReportsDirectory)

0 commit comments

Comments
 (0)