nUnit Tests And Spatial Data Types

David Wilson shows how to build integration tests in nUnit when you’re using spatial data types:

I was recently working on a .NET 4.6 based project that was using EF 6 and nUnit for unit testing. While setting up some integration tests against a local SQL database I was receiving this error:

Spatial types and functions are not available for this provider because the assembly ‘Microsoft.SqlServer.Types’ version 10 or higher could not be found.

We had recently been using SQL Server spatial types for tracking geograpic locations and the tests which performed updates and inserts against these fields were failing.

Read on for the setup instructions.

Related Posts

An Update To ssisUnit

Bartosz Ratajczyk has added some functionality to ssisUnit: Second – you can get and set the properties of the project and its elements. Like – overwriting project connection managers (I designed it with this particular need on my mind). You can now set the connection string the different server (or database) – in the PropertyPath […]

Read More

Testing AG Read-Only Routing

Jess Pomfret shows us how we can use dbatools to test Availability Group read-only routing: The other part I needed to set up was read-only routing, this enables SQL Server to reroute those read only connections to the appropriate replica.  You can also list the read only replicas by priority if you have multiple available or […]

Read More

Categories

May 2018
MTWTFSS
« Apr Jun »
 123456
78910111213
14151617181920
21222324252627
28293031