Commit 12b6b9aa authored by mgravell's avatar mgravell

use SkipTestException

parent ed78dd6a
......@@ -718,7 +718,7 @@ private class HazSqlGeo
[Fact]
public void DBGeography_SO24405645_SO24402424()
{
if (IsMsDataClient) return; // not supported
SkipIfMsDataClient();
EntityFramework.Handlers.Register();
......@@ -741,7 +741,7 @@ public void DBGeography_SO24405645_SO24402424()
[Fact]
public void SqlGeography_SO25538154()
{
if (IsMsDataClient) return; // not supported
SkipIfMsDataClient();
SqlMapper.ResetTypeHandlers();
connection.Execute("create table #SqlGeo (id int, geo geography, geometry geometry)");
......@@ -781,7 +781,7 @@ public void NullableSqlGeometry()
[Fact]
public void SqlHierarchyId_SO18888911()
{
if (IsMsDataClient) return; // not supported
SkipIfMsDataClient();
SqlMapper.ResetTypeHandlers();
var row = connection.Query<HazSqlHierarchy>("select 3 as [Id], hierarchyid::Parse('/1/2/3/') as [Path]").Single();
......
......@@ -22,7 +22,7 @@ public EntityFrameworkTests()
[Fact]
public void Issue570_DbGeo_HasValues()
{
if (IsMsDataClient) return; // not supported
SkipIfMsDataClient();
EntityFramework.Handlers.Register();
const string redmond = "POINT (-122.1215 47.6740)";
......@@ -39,7 +39,7 @@ public void Issue570_DbGeo_HasValues()
[Fact]
public void Issue22_ExecuteScalar_EntityFramework()
{
if (IsMsDataClient) return; // not supported
SkipIfMsDataClient();
var geo = DbGeography.LineFromText("LINESTRING(-122.360 47.656, -122.343 47.656 )", 4326);
var geo2 = connection.ExecuteScalar<DbGeography>("select @geo", new { geo });
......
......@@ -81,7 +81,11 @@ public sealed class MicrosoftSqlClientProvider : SqlServerDatabaseProvider
public abstract class TestBase<TProvider> : IDisposable where TProvider : DatabaseProvider
{
protected bool IsMsDataClient => connection is Microsoft.Data.SqlClient.SqlConnection;
protected void SkipIfMsDataClient()
{
if (connection is Microsoft.Data.SqlClient.SqlConnection)
throw new SkipTestException("Not supported on Microsoft.Data.SqlClient");
}
protected DbConnection GetOpenConnection() => Provider.GetOpenConnection();
protected DbConnection GetClosedConnection() => Provider.GetClosedConnection();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment