You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Migrate Testing.Databases.SqlServer to .NET Standard 2.0
* Reduce the dependencies to .NET 6.0 for Entity Framework and .NET 6 + .NET Framework 4.6.2 for DAC.
* Add an extension method ExecuteScript() to execute a SQL script.
**PosInformatique.Testing.Databases** is a set of tools for testing databases.
4
8
It simplifies writing and executing tests, helping ensure your database and data access code are reliable and bug-free.
@@ -17,7 +21,7 @@ approach.
17
21
18
22
Since the version 2.0.0 this tools provide a comparer to compare the schema of two SQL databases.
19
23
20
-
## The approach of these tools
24
+
## 💡 The approach of these tools
21
25
22
26
The main approach of these tools is to perform tests without using mocking or in-memory alternatives for ADO .NET code or Entity Framework `DbContext`, instead using a real SQL Server database.
23
27
@@ -34,7 +38,7 @@ You also miss technical behaviors like transactions, connection management, trig
34
38
- You perform test cases, meaning you write simple tests to validate small features instead of writing complex integration tests.
35
39
- When changing the schema of the database, it is important to test and have a *safeguard* to check that the migration script (or Entity Framework migration actions) will update the database to the expected schema.
36
40
37
-
## How to test a persistence layer
41
+
## 🧪 How to test a persistence layer
38
42
39
43
To perform tests of a persistence layer, the approach is straightforward using the Arrange/Act/Assert pattern:
40
44
@@ -57,7 +61,7 @@ Before each test (`TestMethod` or `Fact` methods):
57
61
58
62
To write a test using this approach with the [PosInformatique.Testing.Databases](https://github.com/PosInformatique/PosInformatique.Testing.Databases) tools, see the [ Write tests to test the persistence layer](./docs/WriteTest.md) page.
59
63
60
-
## How to test database migration
64
+
## 🧪 How to test database migration
61
65
62
66
To perform tests of a database migration, the approach is straightforward and required only a test which perform the following actions:
63
67
@@ -87,7 +91,7 @@ migration code. It's better than nothing and very useful for detecting issues du
87
91
88
92
To write a test using this approach with the [PosInformatique.Testing.Databases](https://github.com/PosInformatique/PosInformatique.Testing.Databases) tools, see the [Write tests to test database migration](./docs/WriteDatabaseMigrationTest.md) page.
89
93
90
-
## What do the PosInformatique.Testing.Databases tools provide?
94
+
## 📤 What do the PosInformatique.Testing.Databases tools provide?
91
95
92
96
Using the previous approach, the [PosInformatique.Testing.Databases](https://github.com/PosInformatique/PosInformatique.Testing.Databases) libraries allow you to:
93
97
@@ -100,7 +104,7 @@ Using the previous approach, the [PosInformatique.Testing.Databases](https://git
100
104
101
105
- Contain a comparer tool to check schema differences between two databases.
102
106
103
-
## NuGet packages
107
+
## 📦 NuGet packages
104
108
105
109
The [PosInformatique.Testing.Databases](https://github.com/PosInformatique/PosInformatique.Testing.Databases) tools are provided in two NuGet packages:
106
110
@@ -115,7 +119,7 @@ The [PosInformatique.Testing.Databases](https://github.com/PosInformatique/PosIn
115
119
-[PosInformatique.Testing.Databases.SqlServer.EntityFramework](https://www.nuget.org/packages/PosInformatique.Testing.Databases.SqlServer.EntityFramework) NuGet package which contains:
116
120
- Tools to deploy a SQL Server database using a DbContext.
117
121
118
-
## Samples / Demo
122
+
## 🚀 Samples / Demo
119
123
120
124
A complete sample solution is available in this repository inside the [samples](./samples) folder.
121
125
@@ -125,7 +129,7 @@ The solution contains the following sample projects:
125
129
-[DemoApp.DataAccessLayer.Tests](./samples/DemoApp.DataAccessLayer.Tests/DemoApp.DataAccessLayer.Tests.csproj): Test project to test the [DemoApp.DataAccessLayer](./samples/DemoApp.DataAccessLayer/DemoApp.DataAccessLayer.csproj)
126
130
project using the [PosInformatique.Testing.Databases.SqlServer.EntityFramework](https://www.nuget.org/packages/PosInformatique.Testing.Databases.SqlServer.EntityFramework) package.
127
131
128
-
## Writing tests for a persistence layer
132
+
## 📝 Writing tests for a persistence layer
129
133
130
134
To write tests for a persistence layer, follow the [Write tests to test the persistence layer](./docs/WriteTest.md) documentation page, which explains the different steps to perform
131
135
using the [PosInformatique.Testing.Databases.SqlServer.EntityFramework](https://www.nuget.org/packages/PosInformatique.Testing.Databases.SqlServer.EntityFramework) library:
@@ -143,7 +147,7 @@ using the [PosInformatique.Testing.Databases.SqlServer.EntityFramework](https://
143
147
-[Execute the tests](./docs/WriteTest.md#execute-the-tests)
144
148
-[Check the database state after a test has failed](./docs/WriteTest.md#check-the-database-state-after-an-test-has-been-failed)
145
149
146
-
## Writing test to check database migration
150
+
## 📝 Writing test to check database migration
147
151
148
152
To write an test to check the migration of database, follow the [Write tests to test database migration](./docs/WriteDatabaseMigrationTest.md)
<Description>Testing.Databases.SqlServer.Dac is a library that contains a set of tools for testing to deploy DAC (Data-tier Applications) packages (.dacpac files).</Description>
<Description>Testing.Databases.SqlServer.EntityFramework is a library that contains a set of tools for testing Data Access Layer (repositories) based on Entity Framework and SQL Server.</Description>
0 commit comments