Skip to content

Commit 2269153

Browse files
author
Peet Whittaker
committed
Fix unit tests
1 parent 1a477ea commit 2269153

File tree

6 files changed

+17
-15
lines changed

6 files changed

+17
-15
lines changed

Tests.NHibernate.Spatial.MsSql2008/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@ In order to run the tests, a MS SQL Server 2008 instance must be available for c
44

55
### Installation
66

7-
MS SQL Server 2008 Express with Tools is free and can be downloaded from the [MS website](https://www.microsoft.com/en-us/download/details.aspx?id=22973).
7+
MS SQL Server 2008 Express with Tools is free and can be downloaded from the [MS website](https://www.microsoft.com/en-us/download/details.aspx?id=30438) (download and install the `SQLEXPRWT_x64_ENU.exe` package).
88

99
### Configuration
1010

1111
Once MS SQL Server 2008 has been set up, it must be initialized for testing:
1212

1313
1. Ensure that the "Server authentication" is set to "SQL Server and Windows Authentication mode" (see image below).
1414

15-
![Server authentication](http://i.imgur.com/SxkyVpx.png)
15+
![Server authentication](https://i.imgur.com/SxkyVpx.png)
1616

1717
2. After changing the authentication mode, the server must be restarted for the changes to take effect (this can be done via the "SQL Server Configuration Manager").
1818

1919
3. Add a new `nhsp_test` user, using SQL Server authentication with `nhsp_test` for the password and making sure to untick "Enforce password policy" (see image below).
2020

21-
![Create new user](http://i.imgur.com/VIOArTc.png)
21+
![Create new user](https://i.imgur.com/VIOArTc.png)
2222

2323
4. Create a new `nhsp_test` database, owned by the `nhsp_test` user (see image below).
2424

25-
![Create new database](http://i.imgur.com/93mrjwn.png)
25+
![Create new database](https://i.imgur.com/93mrjwn.png)
2626

27-
5. Finally, the `Server=.` part of the connection string in the [app.config](app.config) file should be updated with the name of your server instance, e.g. `Server=hostname\MSSQLSERVER2008`.
27+
5. Finally, the `Server=.` part of the connection string in the [appsettings.json](appsettings.json) file should be updated with the name of your server instance, e.g. `Server=hostname\MSSQLSERVER2008`.

Tests.NHibernate.Spatial.MsSql2008/TestConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static void Configure(Configuration configuration)
2525
[Environment.ProxyFactoryFactoryClass] = typeof(StaticProxyFactoryFactory).AssemblyQualifiedName,
2626
[Environment.Dialect] = typeof(MsSql2008GeometryDialect).AssemblyQualifiedName,
2727
[Environment.ConnectionProvider] = typeof(DebugConnectionProvider).AssemblyQualifiedName,
28-
[Environment.ConnectionDriver] = typeof(SqlClientDriver).AssemblyQualifiedName,
28+
[Environment.ConnectionDriver] = typeof(MicrosoftDataSqlClientDriver).AssemblyQualifiedName,
2929
[Environment.ConnectionString] = _configurationRoot.GetConnectionString("MsSql2008")
3030
};
3131
configuration.SetProperties(properties);
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"ConnectionStrings": {
3-
"_comment": " NOTE: Must specify SQL Server 2012 rather than SQL Server 2008 for the Type System Version attribute (see issue #72)",
4-
"MsSql2008": "Server=(local)\\SQL2008R2SP2;Initial Catalog=nhsp_test;User ID=nhsp_test;Password=nhsp_test;Type System Version=SQL Server 2012"
3+
"_comment1": "NOTE: Must specify SQL Server 2012 rather than SQL Server 2008 for the Type System Version attribute (see issue #72)",
4+
"_comment2": "NOTE: TrustServerCertificate=True required after updating from System.Data.Sql to Microsoft.Data.Sql as Encrypt is now set to true by default; see: https://stackoverflow.com/a/17658821/3628232",
5+
"MsSql2008": "Server=(local)\\MSSQLSERVER2008;Initial Catalog=nhsp_test;User ID=nhsp_test;Password=nhsp_test;Type System Version=SQL Server 2012;TrustServerCertificate=True"
56
}
67
}

Tests.NHibernate.Spatial.MsSql2012/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@ In order to run the tests, a MS SQL Server 2012 instance must be available for c
44

55
### Installation
66

7-
MS SQL Server 2012 Express with Tools is free and can be downloaded from the [MS website]().
7+
MS SQL Server 2012 Express with Tools is free and can be downloaded from the [MS website](https://www.microsoft.com/en-us/download/details.aspx?id=50003) (download and install the `SQLEXPRWT_x64_ENU.exe` package).
88

99
### Configuration
1010

1111
Once MS SQL Server 2012 has been set up, it must be initialized for testing:
1212

1313
1. Ensure that the "Server authentication" is set to "SQL Server and Windows Authentication mode" (see image below).
1414

15-
![Server authentication](http://i.imgur.com/SxkyVpx.png)
15+
![Server authentication](https://i.imgur.com/SxkyVpx.png)
1616

1717
2. After changing the authentication mode, the server must be restarted for the changes to take effect (this can be done via the "SQL Server Configuration Manager").
1818

1919
3. Add a new `nhsp_test` user, using SQL Server authentication with `nhsp_test` for the password and making sure to untick "Enforce password policy" (see image below).
2020

21-
![Create new user](http://i.imgur.com/VIOArTc.png)
21+
![Create new user](https://i.imgur.com/VIOArTc.png)
2222

2323
4. Create a new `nhsp_test` database, owned by the `nhsp_test` user (see image below).
2424

25-
![Create new database](http://i.imgur.com/93mrjwn.png)
25+
![Create new database](https://i.imgur.com/93mrjwn.png)
2626

27-
5. Finally, the `Server=.` part of the connection string in the [app.config](app.config) file should be updated with the name of your server instance, e.g. `Server=(local)\MSSQLSERVER2012`.
27+
5. Finally, the `Server=.` part of the connection string in the [appsettings.json](appsettings.json) file should be updated with the name of your server instance, e.g. `Server=(local)\MSSQLSERVER2012`.

Tests.NHibernate.Spatial.MsSql2012/TestConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static void Configure(Configuration configuration)
2525
[Environment.ProxyFactoryFactoryClass] = typeof(StaticProxyFactoryFactory).AssemblyQualifiedName,
2626
[Environment.Dialect] = typeof(MsSql2012GeometryDialect).AssemblyQualifiedName,
2727
[Environment.ConnectionProvider] = typeof(DebugConnectionProvider).AssemblyQualifiedName,
28-
[Environment.ConnectionDriver] = typeof(SqlClientDriver).AssemblyQualifiedName,
28+
[Environment.ConnectionDriver] = typeof(MicrosoftDataSqlClientDriver).AssemblyQualifiedName,
2929
[Environment.ConnectionString] = _configurationRoot.GetConnectionString("MsSql2012")
3030
};
3131
configuration.SetProperties(properties);
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"ConnectionStrings": {
3-
"MsSql2012": "Server=(local)\\SQL2012SP1;Initial Catalog=nhsp_test;User ID=nhsp_test;Password=nhsp_test;Type System Version=SQL Server 2012"
3+
"_comment": "NOTE: TrustServerCertificate=True required after updating from System.Data.Sql to Microsoft.Data.Sql as Encrypt is now set to true by default; see: https://stackoverflow.com/a/17658821/3628232",
4+
"MsSql2012": "Server=(local)\\MSSQLSERVER2012;Initial Catalog=nhsp_test;User ID=nhsp_test;Password=nhsp_test;Type System Version=SQL Server 2012;TrustServerCertificate=True"
45
}
56
}

0 commit comments

Comments
 (0)