Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lib updates and prepare for Microsoft.Data.SqlClient #1313

Merged
merged 38 commits into from
Aug 28, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
fff9c33
part 1
mgravell Aug 22, 2019
2366f71
sqlclient
mgravell Aug 22, 2019
4a3242a
sqlite
mgravell Aug 22, 2019
45758f6
csharp,sqlite
mgravell Aug 22, 2019
db299c5
xunit,reflection
mgravell Aug 22, 2019
bec85c0
valuetuple,test.sdk
mgravell Aug 22, 2019
3a4cddf
EF
mgravell Aug 22, 2019
f2b3656
bdn
mgravell Aug 22, 2019
57b0e46
various 3rd party
mgravell Aug 22, 2019
46f180c
more 3rd party
mgravell Aug 22, 2019
12312d2
try to include SNI
mgravell Aug 22, 2019
67fc0d8
fix tests for TVPs with SqlDataRecord
mgravell Aug 22, 2019
d97932c
fix inconsistent param name in test proc
mgravell Aug 22, 2019
32b536a
more test fixups
mgravell Aug 22, 2019
e1b503a
detect IEnumerable<T> for some T : IDataRecord dynamically, rather th…
mgravell Aug 27, 2019
719536e
fix sql geo config
mgravell Aug 27, 2019
9ccbb13
don't ref Microsoft.SqlServer.Types when not on framework; you're on …
mgravell Aug 27, 2019
354e63d
drop the SqlClient ref and associated API; this makes it a (minor) br…
mgravell Aug 27, 2019
ed78dd6
make sure System.Data and Microsoft.Data tests can't squabble; record…
mgravell Aug 27, 2019
12b6b9a
use SkipTestException
mgravell Aug 27, 2019
3ff2dab
try targeting ns2.0 *everywhere* possible; remove all unnecessary deps
mgravell Aug 27, 2019
f8297f9
use parameterized $(xUnitVersion)
mgravell Aug 27, 2019
37a36f8
resolve https://github.com/StackExchange/Dapper/pull/1313/files/ed78d…
mgravell Aug 27, 2019
2f7081a
drop nca2.0 config from test project
mgravell Aug 27, 2019
d1b2e15
get rid of all the NS1.3 fallback code
mgravell Aug 27, 2019
0f3911b
TransactionScope isn't supported everywhere
mgravell Aug 27, 2019
3c6cbeb
Merge branch 'master' into lib-updates
mgravell Aug 27, 2019
79edde7
Merge branch 'master' into lib-updates
mgravell Aug 27, 2019
61d1061
remove nca3.0 so CI server can build it
mgravell Aug 27, 2019
cd20c90
use LocalBuilder instead of hard-coded _{0|1|2} in Rainbow
mgravell Aug 28, 2019
10d62ba
revert EF dep to 6.1.3
mgravell Aug 28, 2019
c325ad2
avoid having to hard-code when a size-local is needed in CreateParamI…
mgravell Aug 28, 2019
dd2c7ba
fix bad merge
mgravell Aug 28, 2019
ab64a47
hack around SkipTestException glitch
mgravell Aug 28, 2019
7ebd9db
make AssertNoCacheWorksForQueryMultiple less brittle
mgravell Aug 28, 2019
23ad634
update dynamic skippable code (from SE.Redis tests)
mgravell Aug 28, 2019
ae9d6da
fix bug with Identity not applying type equality correctly; to avoid …
mgravell Aug 28, 2019
c96b0b3
preview build
mgravell Aug 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
make sure System.Data and Microsoft.Data tests can't squabble; record…
… which Microsoft.Data tests *will never work*
  • Loading branch information
mgravell committed Aug 27, 2019
commit ed78dd6a447b1dac20e0bba55848b6fbf87198e6
2 changes: 2 additions & 0 deletions Dapper.Tests/ConstructorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

namespace Dapper.Tests
{
[Collection("ConstructorTests")]
public sealed class SystemSqlClientConstructorTests : ConstructorTests<SystemSqlClientProvider> { }
#if MSSQLCLIENT
[Collection("ConstructorTests")]
public sealed class MicrosoftSqlClientConstructorTests : ConstructorTests<MicrosoftSqlClientProvider> { }
#endif

Expand Down
2 changes: 2 additions & 0 deletions Dapper.Tests/DataReaderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

namespace Dapper.Tests
{
[Collection("DataReaderTests")]
public sealed class SystemSqlClientDataReaderTests : DataReaderTests<SystemSqlClientProvider> { }
#if MSSQLCLIENT
[Collection("DataReaderTests")]
public sealed class MicrosoftSqlClientDataReaderTests : DataReaderTests<MicrosoftSqlClientProvider> { }
#endif

Expand Down
2 changes: 2 additions & 0 deletions Dapper.Tests/DecimalTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

namespace Dapper.Tests
{
[Collection("DecimalTests")]
public sealed class SystemSqlClientDecimalTests : DecimalTests<SystemSqlClientProvider> { }
#if MSSQLCLIENT
[Collection("DecimalTests")]
public sealed class MicrosoftSqlClientDecimalTests : DecimalTests<MicrosoftSqlClientProvider> { }
#endif
public abstract class DecimalTests<TProvider> : TestBase<TProvider> where TProvider : DatabaseProvider
Expand Down
2 changes: 2 additions & 0 deletions Dapper.Tests/EnumTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

namespace Dapper.Tests
{
[Collection("EnumTests")]
public sealed class SystemSqlClientEnumTests : EnumTests<SystemSqlClientProvider> { }
#if MSSQLCLIENT
[Collection("EnumTests")]
public sealed class MicrosoftSqlClientEnumTests : EnumTests<MicrosoftSqlClientProvider> { }
#endif
public abstract class EnumTests<TProvider> : TestBase<TProvider> where TProvider : DatabaseProvider
Expand Down
2 changes: 2 additions & 0 deletions Dapper.Tests/LiteralTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@

namespace Dapper.Tests
{
[Collection("LiteralTests")]
public sealed class SystemSqlClientLiteralTests : LiteralTests<SystemSqlClientProvider> { }
#if MSSQLCLIENT
[Collection("LiteralTests")]
public sealed class MicrosoftSqlClientLiteralTests : LiteralTests<MicrosoftSqlClientProvider> { }
#endif
public abstract class LiteralTests<TProvider> : TestBase<TProvider> where TProvider : DatabaseProvider
Expand Down
2 changes: 2 additions & 0 deletions Dapper.Tests/MiscTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ public GenericUriParser(GenericUriParserOptions options)

namespace Dapper.Tests
{
[Collection("MiscTests")]
public sealed class SystemSqlClientMiscTests : MiscTests<SystemSqlClientProvider> { }
#if MSSQLCLIENT
[Collection("MiscTests")]
public sealed class MicrosoftSqlClientMiscTests : MiscTests<MicrosoftSqlClientProvider> { }
#endif
public abstract class MiscTests<TProvider> : TestBase<TProvider> where TProvider : DatabaseProvider
Expand Down
2 changes: 2 additions & 0 deletions Dapper.Tests/MultiMapTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@

namespace Dapper.Tests
{
[Collection("MultiMapTests")]
public sealed class SystemSqlClientMultiMapTests : MultiMapTests<SystemSqlClientProvider> { }
#if MSSQLCLIENT
[Collection("MultiMapTests")]
public sealed class MicrosoftSqlClientMultiMapTests : MultiMapTests<MicrosoftSqlClientProvider> { }
#endif
public abstract class MultiMapTests<TProvider> : TestBase<TProvider> where TProvider : DatabaseProvider
Expand Down
6 changes: 6 additions & 0 deletions Dapper.Tests/ParameterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,8 @@ private class HazSqlGeo
[Fact]
public void DBGeography_SO24405645_SO24402424()
{
if (IsMsDataClient) return; // not supported

EntityFramework.Handlers.Register();

connection.Execute("create table #Geo (id int, geo geography, geometry geometry)");
Expand All @@ -739,6 +741,8 @@ public void DBGeography_SO24405645_SO24402424()
[Fact]
public void SqlGeography_SO25538154()
{
if (IsMsDataClient) return; // not supported
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


SqlMapper.ResetTypeHandlers();
connection.Execute("create table #SqlGeo (id int, geo geography, geometry geometry)");

Expand Down Expand Up @@ -777,6 +781,8 @@ public void NullableSqlGeometry()
[Fact]
public void SqlHierarchyId_SO18888911()
{
if (IsMsDataClient) return; // not supported

SqlMapper.ResetTypeHandlers();
var row = connection.Query<HazSqlHierarchy>("select 3 as [Id], hierarchyid::Parse('/1/2/3/') as [Path]").Single();
Assert.Equal(3, row.Id);
Expand Down
2 changes: 2 additions & 0 deletions Dapper.Tests/ProcedureTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@

namespace Dapper.Tests
{
[Collection("ProcedureTests")]
public sealed class SystemSqlClientProcedureTests : ProcedureTests<SystemSqlClientProvider> { }
#if MSSQLCLIENT
[Collection("ProcedureTests")]
public sealed class MicrosoftSqlClientProcedureTests : ProcedureTests<MicrosoftSqlClientProvider> { }
#endif
public abstract class ProcedureTests<TProvider> : TestBase<TProvider> where TProvider : DatabaseProvider
Expand Down
4 changes: 4 additions & 0 deletions Dapper.Tests/Providers/EntityFrameworkTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public EntityFrameworkTests()
[Fact]
public void Issue570_DbGeo_HasValues()
{
if (IsMsDataClient) return; // not supported

EntityFramework.Handlers.Register();
const string redmond = "POINT (-122.1215 47.6740)";
DbGeography point = DbGeography.PointFromText(redmond, DbGeography.DefaultCoordinateSystemId);
Expand All @@ -37,6 +39,8 @@ public void Issue570_DbGeo_HasValues()
[Fact]
public void Issue22_ExecuteScalar_EntityFramework()
{
if (IsMsDataClient) return; // not supported

var geo = DbGeography.LineFromText("LINESTRING(-122.360 47.656, -122.343 47.656 )", 4326);
var geo2 = connection.ExecuteScalar<DbGeography>("select @geo", new { geo });
Assert.NotNull(geo2);
Expand Down
2 changes: 2 additions & 0 deletions Dapper.Tests/QueryMultipleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@

namespace Dapper.Tests
{
[Collection("QueryMultipleTests")]
public sealed class SystemSqlClientQueryMultipleTests : QueryMultipleTests<SystemSqlClientProvider> { }
#if MSSQLCLIENT
[Collection("QueryMultipleTests")]
public sealed class MicrosoftSqlClientQueryMultipleTests : QueryMultipleTests<MicrosoftSqlClientProvider> { }
#endif
public abstract class QueryMultipleTests<TProvider> : TestBase<TProvider> where TProvider : DatabaseProvider
Expand Down
2 changes: 2 additions & 0 deletions Dapper.Tests/TestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ public sealed class MicrosoftSqlClientProvider : SqlServerDatabaseProvider

public abstract class TestBase<TProvider> : IDisposable where TProvider : DatabaseProvider
{
protected bool IsMsDataClient => connection is Microsoft.Data.SqlClient.SqlConnection;

protected DbConnection GetOpenConnection() => Provider.GetOpenConnection();
protected DbConnection GetClosedConnection() => Provider.GetClosedConnection();
protected DbConnection _connection;
Expand Down
2 changes: 2 additions & 0 deletions Dapper.Tests/TransactionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@

namespace Dapper.Tests
{
[Collection("TransactionTests")]
public sealed class SystemSqlClientTransactionTests : TransactionTests<SystemSqlClientProvider> { }
#if MSSQLCLIENT
[Collection("TransactionTests")]
public sealed class MicrosoftSqlClientTransactionTests : TransactionTests<MicrosoftSqlClientProvider> { }
#endif
public abstract class TransactionTests<TProvider> : TestBase<TProvider> where TProvider : DatabaseProvider
Expand Down
2 changes: 2 additions & 0 deletions Dapper.Tests/TupleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@

namespace Dapper.Tests
{
[Collection("TupleTests")]
public sealed class SystemSqlClientTupleTests : TupleTests<SystemSqlClientProvider> { }
#if MSSQLCLIENT
[Collection("TupleTests")]
public sealed class MicrosoftSqlClientTupleTests : TupleTests<MicrosoftSqlClientProvider> { }
#endif
public abstract class TupleTests<TProvider> : TestBase<TProvider> where TProvider : DatabaseProvider
Expand Down
2 changes: 2 additions & 0 deletions Dapper.Tests/XmlTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

namespace Dapper.Tests
{
[Collection("XmlTests")]
public sealed class SystemSqlClientXmlTests : XmlTests<SystemSqlClientProvider> { }
#if MSSQLCLIENT
[Collection("XmlTests")]
public sealed class MicrosoftSqlClientXmlTests : XmlTests<MicrosoftSqlClientProvider> { }
#endif
public abstract class XmlTests<TProvider> : TestBase<TProvider> where TProvider : DatabaseProvider
Expand Down