Skip to content

Commit 0ff5d49

Browse files
v1.0.0 (#1)
* Initial version
1 parent 316b653 commit 0ff5d49

File tree

122 files changed

+3807
-0
lines changed

Some content is hidden

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

122 files changed

+3807
-0
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[*.cs]
2+
3+
# StyleCop
4+
5+
# SA1600: Elements should be documented
6+
dotnet_diagnostic.SA1600.severity = none
7+
8+
# SA1601: Partial elements should be documented
9+
dotnet_diagnostic.SA1601.severity = none
10+
11+
# SA1602: Enumeration items should be documented
12+
dotnet_diagnostic.SA1602.severity = none
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Continuous Integration
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
push:
7+
branches: [ "releases/**" ]
8+
9+
jobs:
10+
build:
11+
runs-on: windows-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Setup NuGet
16+
uses: nuget/setup-nuget@v2
17+
18+
- name: Restore NuGet packages
19+
run: nuget restore PosInformatique.UnitTests.Databases.sln
20+
21+
- name: Add msbuild to PATH
22+
uses: microsoft/setup-msbuild@v2
23+
24+
- name: Build
25+
run: msbuild "PosInformatique.UnitTests.Databases.sln" /p:Configuration=Debug
26+
27+
- name: Restore NuGet packages
28+
run: nuget restore "samples/PosInformatique.UnitTests.Databases.Samples.sln"
29+
30+
- name: Build the samples
31+
run: msbuild "samples/PosInformatique.UnitTests.Databases.Samples.sln" /p:Configuration=Debug
32+
33+
- name: Creates the LocalDB for the unit tests
34+
shell: cmd
35+
run: SqlLocalDB create posinfo-unit-tests
36+
37+
- name: Creates the SQL Login service accounts for the unit tests
38+
shell: cmd
39+
run: sqlcmd -S "(localDB)\posinfo-unit-tests" -Q "IF NOT EXISTS (SELECT 1 FROM [sys].[server_principals] WHERE [Name] = 'ServiceAccountLogin') CREATE LOGIN [ServiceAccountLogin] WITH PASSWORD = 'P@ssw0rd'"
40+
41+
# Use this fix https://github.com/microsoft/vstest-action/issues/31#issuecomment-2159463764
42+
- name: Test with the dotnet CLI
43+
uses: rusty-bender/vstest-action@main
44+
with:
45+
searchFolder: .\
46+
testAssembly: |
47+
/tests/**/*tests.dll
48+
!./**/*TestAdapter.dll
49+
!./**/obj/**
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
VersionPrefix:
7+
type: string
8+
description: The version of the library
9+
required: true
10+
default: 1.0.0
11+
VersionSuffix:
12+
type: string
13+
description: The version suffix of the library (for example rc.1)
14+
15+
run-name: ${{ inputs.VersionPrefix }}-${{ inputs.VersionSuffix }}
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Setup .NET 8.x
24+
uses: actions/setup-dotnet@v4
25+
with:
26+
dotnet-version: '8.x'
27+
28+
- name: Build UnitTests.Databases.SqlServer
29+
run: dotnet pack
30+
--property:Configuration=Release
31+
--property:VersionPrefix=${{ github.event.inputs.VersionPrefix }}
32+
--property:VersionSuffix=${{ github.event.inputs.VersionSuffix }}
33+
"src/UnitTests.Databases.SqlServer/UnitTests.Databases.SqlServer.csproj"
34+
35+
- name: Build UnitTests.Databases.SqlServer.EntityFramework
36+
run: dotnet pack
37+
--property:Configuration=Release
38+
--property:VersionPrefix=${{ github.event.inputs.VersionPrefix }}
39+
--property:VersionSuffix=${{ github.event.inputs.VersionSuffix }}
40+
"src/UnitTests.Databases.SqlServer.EntityFramework/UnitTests.Databases.SqlServer.EntityFramework.csproj"
41+
42+
- name: Publish the package to nuget.org
43+
run: dotnet nuget push "src/**/bin/Release/*.nupkg" --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json

CodeCoverage.runsettings

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- File name extension must be .runsettings -->
3+
<RunSettings>
4+
<DataCollectionRunSettings>
5+
<DataCollectors>
6+
<DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
7+
<Configuration>
8+
<CodeCoverage>
9+
10+
<!-- Match assembly file paths: -->
11+
<ModulePaths>
12+
<Include>
13+
<ModulePath>.*\.dll$</ModulePath>
14+
</Include>
15+
<Exclude>
16+
<ModulePath>.*xunit.*</ModulePath>
17+
<ModulePath>.*webjobs.*</ModulePath>
18+
<ModulePath>moq.*</ModulePath>
19+
<ModulePath>.*durabletask.*</ModulePath>
20+
<ModulePath>microsoft.*</ModulePath>
21+
<ModulePath>bouncycastle.*</ModulePath>
22+
<ModulePath>.*tests\.dll$</ModulePath>
23+
</Exclude>
24+
</ModulePaths>
25+
26+
<Attributes>
27+
<Exclude>
28+
<!-- Exclude generated code from code coverage -->
29+
<Attribute>^System\.CodeDom\.Compiler\.GeneratedCodeAttribute$</Attribute>
30+
<Attribute>^System\.Diagnostics\.CodeAnalysis\.ExcludeFromCodeCoverageAttribute$</Attribute>
31+
</Exclude>
32+
</Attributes>
33+
34+
<CompanyNames>
35+
<Include>
36+
<CompanyName>.*PosInformatique.*</CompanyName>
37+
</Include>
38+
</CompanyNames>
39+
40+
<!-- We recommend you do not change the following values: -->
41+
<UseVerifiableInstrumentation>True</UseVerifiableInstrumentation>
42+
<AllowLowIntegrityProcesses>True</AllowLowIntegrityProcesses>
43+
<CollectFromChildProcesses>True</CollectFromChildProcesses>
44+
<CollectAspDotNet>False</CollectAspDotNet>
45+
46+
</CodeCoverage>
47+
</Configuration>
48+
</DataCollector>
49+
</DataCollectors>
50+
</DataCollectionRunSettings>
51+
</RunSettings>

Directory.Build.props

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<Project>
2+
3+
<!-- Common properties -->
4+
<PropertyGroup>
5+
<Authors>Gilles TOURREAU</Authors>
6+
<Company>P.O.S Informatique</Company>
7+
<Product>P.O.S Informatique</Product>
8+
<Copyright>Copyright (c) P.O.S Informatique. All rights reserved.</Copyright>
9+
<RepositoryUrl>https://github.com/PosInformatique/PosInformatique.UnitTests.Databases</RepositoryUrl>
10+
<RepositoryType>git</RepositoryType>
11+
12+
<!-- Enable the last version of C# -->
13+
<LangVersion>latest</LangVersion>
14+
15+
<!-- Enable implict usings -->
16+
<ImplicitUsings>enable</ImplicitUsings>
17+
18+
<!-- Disable the Analyzers in Release configuration -->
19+
<RunAnalyzers Condition="'$(Configuration)' == 'Release'">false</RunAnalyzers>
20+
21+
<!-- Disable the StyleCop 'XML comment analysis is disabled due to project configuration' warning. -->
22+
<NoWarn>$(NoWarn);SA0001</NoWarn>
23+
24+
<!-- By default prefix all the assemblies name with ChantierConnect -->
25+
<AssemblyName>PosInformatique.$(MSBuildProjectName)</AssemblyName>
26+
<RootNamespace>PosInformatique.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
27+
</PropertyGroup>
28+
29+
<ItemGroup>
30+
<AdditionalFiles Include="..\..\stylecop.json">
31+
<Link>stylecop.json</Link>
32+
</AdditionalFiles>
33+
</ItemGroup>
34+
35+
<!-- Common NuGet packages -->
36+
<ItemGroup>
37+
<PackageReference Include="StyleCop.Analyzers">
38+
<PrivateAssets>all</PrivateAssets>
39+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
40+
</PackageReference>
41+
</ItemGroup>
42+
43+
<!-- Add the default using directive for all the code -->
44+
<ItemGroup>
45+
<Using Include="System" />
46+
<Using Include="System.Threading.Tasks" />
47+
</ItemGroup>
48+
49+
</Project>

Directory.Packages.props

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project>
2+
<PropertyGroup>
3+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4+
</PropertyGroup>
5+
<ItemGroup>
6+
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
7+
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
8+
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.8" />
9+
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
10+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
11+
<PackageVersion Include="Microsoft.SqlServer.DacFx" Version="162.3.566" />
12+
<PackageVersion Include="PosInformatique.UnitTests.Databases.SqlServer.EntityFramework" Version="0.9.11" />
13+
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
14+
<PackageVersion Include="xunit" Version="2.9.0" />
15+
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
16+
</ItemGroup>
17+
</Project>
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.10.35201.131
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BFE7322A-DFBA-4CE1-A3D8-7EBB4CD6F586}"
7+
ProjectSection(SolutionItems) = preProject
8+
.editorconfig = .editorconfig
9+
.gitignore = .gitignore
10+
CodeCoverage.runsettings = CodeCoverage.runsettings
11+
Directory.Build.props = Directory.Build.props
12+
Directory.Packages.props = Directory.Packages.props
13+
LICENSE = LICENSE
14+
README.md = README.md
15+
stylecop.json = stylecop.json
16+
EndProjectSection
17+
EndProject
18+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests.Databases.SqlServer", "src\UnitTests.Databases.SqlServer\UnitTests.Databases.SqlServer.csproj", "{4CE1DA94-B254-45D3-8014-EB8055E38A01}"
19+
EndProject
20+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{1E437195-1225-443D-BD19-8796F31B1E2B}"
21+
ProjectSection(SolutionItems) = preProject
22+
tests\.editorconfig = tests\.editorconfig
23+
tests\Directory.Build.props = tests\Directory.Build.props
24+
EndProjectSection
25+
EndProject
26+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests.Databases.SqlServer.Tests", "tests\UnitTests.Databases.SqlServer.Tests\UnitTests.Databases.SqlServer.Tests.csproj", "{C87E8F0D-D96D-4D77-9713-5564DC2E3597}"
27+
EndProject
28+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{49103176-7D08-4386-B445-76E9823503F8}"
29+
ProjectSection(SolutionItems) = preProject
30+
src\.editorconfig = src\.editorconfig
31+
src\Directory.Build.props = src\Directory.Build.props
32+
EndProjectSection
33+
EndProject
34+
Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "UnitTests.Databases.SqlServer.Tests.DacPac", "tests\UnitTests.Databases.SqlServer.Tests.DacPac\UnitTests.Databases.SqlServer.Tests.DacPac.sqlproj", "{5F618225-0E1C-46A7-BBCC-23A6243D5CEE}"
35+
EndProject
36+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{91BFD2B1-6AB6-4B07-9D2E-430C93F150D4}"
37+
EndProject
38+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{F8700AE9-9613-4CFE-B870-FAD786607D53}"
39+
ProjectSection(SolutionItems) = preProject
40+
.github\workflows\github-actions-ci.yaml = .github\workflows\github-actions-ci.yaml
41+
.github\workflows\github-actions-release.yml = .github\workflows\github-actions-release.yml
42+
EndProjectSection
43+
EndProject
44+
Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "UnitTests.Databases.SqlServer.Tests.Source", "tests\UnitTests.Databases.SqlServer.Tests.Source\UnitTests.Databases.SqlServer.Tests.Source.sqlproj", "{A261D4FF-9BEA-475C-8671-E9BACFDCE960}"
45+
EndProject
46+
Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "UnitTests.Databases.SqlServer.Tests.Target", "tests\UnitTests.Databases.SqlServer.Tests.Target\UnitTests.Databases.SqlServer.Tests.Target.sqlproj", "{6CD3F177-053F-4816-A37E-5CA6F293D34C}"
47+
EndProject
48+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests.Databases.SqlServer.EntityFramework", "src\UnitTests.Databases.SqlServer.EntityFramework\UnitTests.Databases.SqlServer.EntityFramework.csproj", "{157DDF0D-9410-4646-94B9-9CEE4C140F5E}"
49+
EndProject
50+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests.Databases.SqlServer.EntityFramework.Tests", "tests\UnitTests.Databases.SqlServer.EntityFramework.Tests\UnitTests.Databases.SqlServer.EntityFramework.Tests.csproj", "{04A7AE8F-FE77-435B-9250-600388BB8065}"
51+
EndProject
52+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{8500A9B6-CAA0-432C-BABB-DDC86CE08994}"
53+
ProjectSection(SolutionItems) = preProject
54+
docs\WriteUnitTests.md = docs\WriteUnitTests.md
55+
EndProjectSection
56+
EndProject
57+
Global
58+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
59+
Debug|Any CPU = Debug|Any CPU
60+
Release|Any CPU = Release|Any CPU
61+
EndGlobalSection
62+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
63+
{4CE1DA94-B254-45D3-8014-EB8055E38A01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
64+
{4CE1DA94-B254-45D3-8014-EB8055E38A01}.Debug|Any CPU.Build.0 = Debug|Any CPU
65+
{4CE1DA94-B254-45D3-8014-EB8055E38A01}.Release|Any CPU.ActiveCfg = Release|Any CPU
66+
{4CE1DA94-B254-45D3-8014-EB8055E38A01}.Release|Any CPU.Build.0 = Release|Any CPU
67+
{C87E8F0D-D96D-4D77-9713-5564DC2E3597}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
68+
{C87E8F0D-D96D-4D77-9713-5564DC2E3597}.Debug|Any CPU.Build.0 = Debug|Any CPU
69+
{C87E8F0D-D96D-4D77-9713-5564DC2E3597}.Release|Any CPU.ActiveCfg = Release|Any CPU
70+
{C87E8F0D-D96D-4D77-9713-5564DC2E3597}.Release|Any CPU.Build.0 = Release|Any CPU
71+
{5F618225-0E1C-46A7-BBCC-23A6243D5CEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
72+
{5F618225-0E1C-46A7-BBCC-23A6243D5CEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
73+
{5F618225-0E1C-46A7-BBCC-23A6243D5CEE}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
74+
{5F618225-0E1C-46A7-BBCC-23A6243D5CEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
75+
{5F618225-0E1C-46A7-BBCC-23A6243D5CEE}.Release|Any CPU.Build.0 = Release|Any CPU
76+
{5F618225-0E1C-46A7-BBCC-23A6243D5CEE}.Release|Any CPU.Deploy.0 = Release|Any CPU
77+
{A261D4FF-9BEA-475C-8671-E9BACFDCE960}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
78+
{A261D4FF-9BEA-475C-8671-E9BACFDCE960}.Debug|Any CPU.Build.0 = Debug|Any CPU
79+
{A261D4FF-9BEA-475C-8671-E9BACFDCE960}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
80+
{A261D4FF-9BEA-475C-8671-E9BACFDCE960}.Release|Any CPU.ActiveCfg = Release|Any CPU
81+
{A261D4FF-9BEA-475C-8671-E9BACFDCE960}.Release|Any CPU.Build.0 = Release|Any CPU
82+
{A261D4FF-9BEA-475C-8671-E9BACFDCE960}.Release|Any CPU.Deploy.0 = Release|Any CPU
83+
{6CD3F177-053F-4816-A37E-5CA6F293D34C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
84+
{6CD3F177-053F-4816-A37E-5CA6F293D34C}.Debug|Any CPU.Build.0 = Debug|Any CPU
85+
{6CD3F177-053F-4816-A37E-5CA6F293D34C}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
86+
{6CD3F177-053F-4816-A37E-5CA6F293D34C}.Release|Any CPU.ActiveCfg = Release|Any CPU
87+
{6CD3F177-053F-4816-A37E-5CA6F293D34C}.Release|Any CPU.Build.0 = Release|Any CPU
88+
{6CD3F177-053F-4816-A37E-5CA6F293D34C}.Release|Any CPU.Deploy.0 = Release|Any CPU
89+
{157DDF0D-9410-4646-94B9-9CEE4C140F5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
90+
{157DDF0D-9410-4646-94B9-9CEE4C140F5E}.Debug|Any CPU.Build.0 = Debug|Any CPU
91+
{157DDF0D-9410-4646-94B9-9CEE4C140F5E}.Release|Any CPU.ActiveCfg = Release|Any CPU
92+
{157DDF0D-9410-4646-94B9-9CEE4C140F5E}.Release|Any CPU.Build.0 = Release|Any CPU
93+
{04A7AE8F-FE77-435B-9250-600388BB8065}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
94+
{04A7AE8F-FE77-435B-9250-600388BB8065}.Debug|Any CPU.Build.0 = Debug|Any CPU
95+
{04A7AE8F-FE77-435B-9250-600388BB8065}.Release|Any CPU.ActiveCfg = Release|Any CPU
96+
{04A7AE8F-FE77-435B-9250-600388BB8065}.Release|Any CPU.Build.0 = Release|Any CPU
97+
EndGlobalSection
98+
GlobalSection(SolutionProperties) = preSolution
99+
HideSolutionNode = FALSE
100+
EndGlobalSection
101+
GlobalSection(NestedProjects) = preSolution
102+
{1E437195-1225-443D-BD19-8796F31B1E2B} = {BFE7322A-DFBA-4CE1-A3D8-7EBB4CD6F586}
103+
{49103176-7D08-4386-B445-76E9823503F8} = {BFE7322A-DFBA-4CE1-A3D8-7EBB4CD6F586}
104+
{91BFD2B1-6AB6-4B07-9D2E-430C93F150D4} = {BFE7322A-DFBA-4CE1-A3D8-7EBB4CD6F586}
105+
{F8700AE9-9613-4CFE-B870-FAD786607D53} = {91BFD2B1-6AB6-4B07-9D2E-430C93F150D4}
106+
{8500A9B6-CAA0-432C-BABB-DDC86CE08994} = {BFE7322A-DFBA-4CE1-A3D8-7EBB4CD6F586}
107+
EndGlobalSection
108+
GlobalSection(ExtensibilityGlobals) = postSolution
109+
SolutionGuid = {FAC64573-D665-48A8-AC75-7B82B692EC9E}
110+
EndGlobalSection
111+
EndGlobal

0 commit comments

Comments
 (0)