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
27 changes: 12 additions & 15 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
name: .NET
name: Unit Test .NET

on:
push:
branches: [ main, dev, feature/*, fix/*, release/* ]

pull_request:
branches: [ main ]

release:
types: [ published ]
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
- uses: actions/checkout@v6
- name: Setup dotnet
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
# dotnet-quality: 'preview' # When using preview versions
dotnet-quality: 'ga' # General Availability

# Create Local NuGet Source

Expand All @@ -36,19 +33,19 @@ jobs:
# UnitTest.Data

- name: Restore UnitTest.Data
run: dotnet restore ./src/*/*/UnitTest.Data.csproj
run: dotnet restore ./src/*/UnitTest.Data.csproj

- name: Build UnitTest.Data
run: dotnet build ./src/*/*/UnitTest.Data.csproj --no-restore -c Release
run: dotnet build ./src/*/UnitTest.Data.csproj --no-restore -c Release

- name: Pack UnitTest.Data
run: dotnet pack ./src/*/*/UnitTest.Data.csproj --no-restore -o ~/nuget -c Release
run: dotnet pack ./src/*/UnitTest.Data.csproj --no-restore -o ~/nuget -c Release

- name: Restore UnitTest.Data.Tests
run: dotnet restore ./src/*/*/UnitTest.Data.Tests.fsproj
run: dotnet restore ./src/*/UnitTest.Data.Tests.fsproj

- name: Test UnitTest.Data.Tests
run: dotnet test ./src/*/*/UnitTest.Data.Tests.fsproj --no-restore -c Release
run: dotnet test ./src/*/UnitTest.Data.Tests.fsproj --no-restore -c Release

# Push

Expand Down
66 changes: 47 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*.user
*.userosscache
*.sln.docstates
*.env

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
Expand All @@ -21,17 +22,37 @@ mono_crash.*
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/

[Dd]ebug/x64/
[Dd]ebugPublic/x64/
[Rr]elease/x64/
[Rr]eleases/x64/
bin/x64/
obj/x64/

[Dd]ebug/x86/
[Dd]ebugPublic/x86/
[Rr]elease/x86/
[Rr]eleases/x86/
bin/x86/
obj/x86/

[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
[Aa][Rr][Mm]64[Ee][Cc]/
bld/
[Bb]in/
[Oo]bj/
[Oo]ut/
[Ll]og/
[Ll]ogs/

# Build results on 'Bin' directories
**/[Bb]in/*
# Uncomment if you have tasks that rely on *.refresh files to move binaries
# (https://github.com/github/gitignore/pull/3736)
#!**/[Bb]in/*.refresh

# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
Expand All @@ -43,12 +64,16 @@ Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
*.trx

# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml

# Approval Tests result files
*.received.*

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
Expand All @@ -75,6 +100,7 @@ StyleCopReport.xml
*.ilk
*.meta
*.obj
*.idb
*.iobj
*.pch
*.pdb
Expand Down Expand Up @@ -155,6 +181,7 @@ coverage*.info

# NCrunch
_NCrunch_*
.NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*

Expand Down Expand Up @@ -296,9 +323,6 @@ node_modules/
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw

# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp

# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp
Expand All @@ -316,22 +340,22 @@ node_modules/
_Pvt_Extensions

# Paket dependency manager
.paket/paket.exe
**/.paket/paket.exe
paket-files/

# FAKE - F# Make
.fake/
**/.fake/

# CodeRush personal settings
.cr/personal
**/.cr/personal

# Python Tools for Visual Studio (PTVS)
__pycache__/
**/__pycache__/
*.pyc

# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
#tools/**
#!tools/packages.config

# Tabs Studio
*.tss
Expand All @@ -353,15 +377,19 @@ ASALocalRun/

# MSBuild Binary and Structured Log
*.binlog
MSBuild_Logs/

# AWS SAM Build and Temporary Artifacts folder
.aws-sam

# NVidia Nsight GPU debugger configuration file
*.nvuser

# MFractors (Xamarin productivity tool) working folder
.mfractor/
**/.mfractor/

# Local History for Visual Studio
.localhistory/
**/.localhistory/

# Visual Studio History (VSHistory) files
.vshistory/
Expand All @@ -373,7 +401,7 @@ healthchecksdb
MigrationBackup/

# Ionide (cross platform F# VS Code tools) working folder
.ionide/
**/.ionide/

# Fody - auto-generated XML schema
FodyWeavers.xsd
Expand All @@ -384,17 +412,17 @@ FodyWeavers.xsd
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp

# JetBrains Rider
*.sln.iml
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-2025 Andrei Sergeev, Pavel Moskovoy
Copyright (c) 2020-2026 Andrei Sergeev, Pavel Moskovoy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
namespace PrimeFuncPack.UnitTest.Data.Tests

open DeepEqual.Syntax
open Xunit

module internal TestHelper =
Expand All @@ -11,11 +10,11 @@ module internal TestHelper =
let internal shouldBeTheSame expected actual =
Assert.Same(expected = expected, actual = actual)

let internal shouldBeEqual<'t> (expected : 't) actual =
Assert.Equal(expected = expected, actual = actual)
let internal shouldBeEqual<'t> (expected : 't) (actual : 't) =
Assert.Equal<'t>(expected, actual)

let internal shouldBeEqualString (expected: string) (actual: string) =
Assert.Equal(expected = expected, actual = actual, ignoreCase = false)

let internal shouldBeDeepEqual expected actual =
actual.ShouldDeepEqual(expected)
Assert.Equivalent(expected = expected, actual = actual)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net10.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -11,10 +11,9 @@
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<Authors>Andrei Sergeev, Pavel Moskovoy</Authors>
<Copyright>Copyright © 2020-2025 Andrei Sergeev, Pavel Moskovoy</Copyright>
<Copyright>Copyright © 2020-2026 Andrei Sergeev, Pavel Moskovoy</Copyright>
<RootNamespace>PrimeFuncPack.UnitTest.Data.Tests</RootNamespace>
<AssemblyName>PrimeFuncPack.UnitTest.Data.Tests</AssemblyName>
<GenerateProgramFile>true</GenerateProgramFile>
</PropertyGroup>

<ItemGroup>
Expand All @@ -28,21 +27,30 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\UnitTest.Data\UnitTest.Data.csproj" />
<!--
This template uses native xUnit.net command line options when using 'dotnet run' and
VSTest by default when using 'dotnet test'. For more information on how to enable support
for Microsoft Testing Platform, please visit:
https://xunit.net/docs/getting-started/v3/microsoft-testing-platform
-->
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.3">
<PackageReference Include="coverlet.collector" Version="10.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="DeepEqual" Version="5.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.v3" Version="3.2.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\UnitTest.Data\UnitTest.Data.csproj" />
</ItemGroup>

</Project>
</Project>
3 changes: 3 additions & 0 deletions src/UnitTest.Data.Tests/xunit.runner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json"
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
namespace PrimeFuncPack.UnitTest;
public enum EnumType
{
Zero,
One,
Two,
Three,
Four,
Five,
Six,
Seven,
Eight,
Nine
}
namespace PrimeFuncPack.UnitTest;

public enum EnumType
{
Zero,

One,

Two,

Three,

Four,

Five,

Six,

Seven,

Eight,

Nine,
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public struct StructType
{
public string? Text { readonly get; set; }

public override string? ToString()
public override readonly string? ToString()
=>
Invariant($"{nameof(StructType)}: '{Text}'");
}
Loading