Skip to content

Commit e347b09

Browse files
v1.0.1 (#2)
* Various fixes of the documentation
1 parent 0ff5d49 commit e347b09

File tree

5 files changed

+23
-11
lines changed

5 files changed

+23
-11
lines changed

.editorconfig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
[*.cs]
1+
[*]
2+
indent_style = space
3+
indent_size = 4
4+
5+
[*.cs]
26

37
# StyleCop
48

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,25 +63,25 @@ Using the previous approach, the [PosInformatique.UnitTests.Databases](https://g
6363

6464
The [PosInformatique.UnitTests.Databases](https://github.com/PosInformatique/PosInformatique.UnitTests.Databases) tools are provided in two NuGet packages:
6565

66-
- [![Nuget](https://img.shields.io/nuget/v/PosInformatique.UnitTests.Databases.SqlServer)](https://www.nuget.org/packages/PosInformatique.UnitTests.Databases.SqlServer) which contains:
66+
- [PosInformatique.UnitTests.Databases.SqlServer](https://www.nuget.org/packages/PosInformatique.UnitTests.Databases.SqlServer) NuGet package which contains:
6767
- Tools to deploy a SQL Server database using a DACPAC file before each unit test.
6868
- Helpers to initialize SQL Server databases with sample data.
6969
- Helpers to easily query SQL Server databases.
7070

71-
- [![Nuget](https://img.shields.io/nuget/v/PosInformatique.UnitTests.Databases.SqlServer.EntityFramework)](https://www.nuget.org/packages/PosInformatique.UnitTests.Databases.SqlServer.EntityFramework) which contains:
71+
- [PosInformatique.UnitTests.Databases.SqlServer.EntityFramework](https://www.nuget.org/packages/PosInformatique.UnitTests.Databases.SqlServer.EntityFramework) NuGet package which contains:
7272
- Tools to deploy a SQL Server database using a DbContext.
7373

7474
This package uses and includes the previous [PosInformatique.UnitTests.Databases.SqlServer](https://www.nuget.org/packages/PosInformatique.UnitTests.Databases.SqlServer) NuGet package.
7575

7676
## Samples / Demo
7777

78-
A complete sample solution is available in this repository in the [./samples](./samples) folder.
78+
A complete sample solution is available in this repository inside the [samples](./samples) folder.
7979

80-
The solution contains the following projects:
80+
The solution contains the following sample projects:
8181
- [DemoApp.Domain](./samples/DemoApp.Domain/DemoApp.Domain.csproj): Represents the domain of the application with a set of sample business entities.
8282
- [DemoApp.DataAccessLayer](./samples/DemoApp.DataAccessLayer/DemoApp.DataAccessLayer.csproj): Represents a Data Access Layer with a set of repositories to unit test.
8383
- [DemoApp.DataAccessLayer.Tests](./samples/DemoApp.DataAccessLayer.Tests/DemoApp.DataAccessLayer.Tests.csproj): Unit test project to test the [DemoApp.DataAccessLayer](./samples/DemoApp.DataAccessLayer/DemoApp.DataAccessLayer.csproj)
84-
- project using the [PosInformatique.UnitTests.Databases.SqlServer](https://www.nuget.org/packages/PosInformatique.UnitTests.Databases.SqlServer) package.
84+
project using the [PosInformatique.UnitTests.Databases.SqlServer.EntityFramework](https://www.nuget.org/packages/PosInformatique.UnitTests.Databases.SqlServer.EntityFramework) package.
8585

8686
## Writing unit tests for a Data Access Layer
8787

docs/WriteUnitTests.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public class CustomerRepository
5757

5858
Which use the following `DbContext` implementation:
5959

60-
```json
60+
```csharp
6161
public class DemoAppDbContext : DbContext
6262
{
6363
public DemoAppDbContext(DbContextOptions<DemoAppDbContext> options)
@@ -282,6 +282,7 @@ this.database.InsertCustomer(id: 10, firstName: "John", lastName: "DOE");
282282

283283
In the end, if we want to insert 3 `Customer` rows in the database, the `CustomerRepositoryTest` constructor should look like this code:
284284

285+
```csharp
285286
public CustomerRepositoryTest(SqlServerDatabaseInitializer initializer)
286287
{
287288
using var dbContext = new DemoAppDbContext(UnitTestsConnectionStrings.CreateDbContextOptions<DemoAppDbContext>(DatabaseName));
@@ -292,6 +293,7 @@ public CustomerRepositoryTest(SqlServerDatabaseInitializer initializer)
292293
this.database.InsertCustomer(id: 15, firstName: "Marcel", lastName: "DUPONT", revenue: 4852.45);
293294
this.database.InsertCustomer(id: 20, firstName: "Andres", lastName: "GARCIA");
294295
}
296+
```
295297

296298
Now, every time we will execute an unit test in the `CustomerRepositoryTest` class,
297299
a database will be deployed with these 3 `Customer` before the execution of the unit test.

src/UnitTests.Databases.SqlServer.EntityFramework/UnitTests.Databases.SqlServer.EntityFramework.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010
<PackageReadmeFile>README.md</PackageReadmeFile>
1111
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1212
<PackageReleaseNotes>
13-
1.0.0
14-
- Initial version
13+
1.0.1
14+
- Fix the documentation
15+
16+
1.0.0
17+
- Initial version
1518
</PackageReleaseNotes>
1619
<PackageTags>unittest entityframework sqlserver repository tdd dataaccesslayer</PackageTags>
1720
</PropertyGroup>

src/UnitTests.Databases.SqlServer/UnitTests.Databases.SqlServer.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010
<PackageReadmeFile>README.md</PackageReadmeFile>
1111
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1212
<PackageReleaseNotes>
13-
1.0.0
14-
- Initial version
13+
1.0.1
14+
- Fix the documentation
15+
16+
1.0.0
17+
- Initial version
1518
</PackageReleaseNotes>
1619
<PackageTags>unittest sqlserver repository tdd dataaccesslayer</PackageTags>
1720
</PropertyGroup>

0 commit comments

Comments
 (0)