Skip to content
This repository has been archived by the owner on Nov 20, 2022. It is now read-only.

Simplify setup of a SQL database for unit tests #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

0xced
Copy link

@0xced 0xced commented Sep 17, 2021

Using the LocalDb NuGet package makes it very easy to setup a test database. With the connection string from the App.config file I would get an exception:

System.Data.SqlClient.SqlException
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 50 - Local Database Runtime error occurred. Cannot create an automatic instance. See the Windows Application event log for error details.)

@0xced 0xced force-pushed the tests-with-localdb-package branch from fc7811c to 25a9bfb Compare September 17, 2021 09:44
Using the LocalDb NuGet package makes it very easy to setup a test database. With the connection string from the App.config file I would get an exception:
> System.Data.SqlClient.SqlException
> A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 50 - Local Database Runtime error occurred. Cannot create an automatic instance. See the Windows Application event log for error details.)
* Microsoft.NET.Test.Sdk → 16.11.0
* xunit.runner.visualstudio → 2.4.3
* xunit → 2.4.1

Also remove Dapper and NodaTime dependencies which are transitive through Dapper.NodaTime.csproj
@0xced 0xced force-pushed the tests-with-localdb-package branch from 08fd2f9 to 3d1e833 Compare September 20, 2021 07:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant