Commit 76c2e186 authored by Nick Craver's avatar Nick Craver

More test fixes

parent 4637c100
...@@ -4,10 +4,7 @@ ...@@ -4,10 +4,7 @@
namespace Dapper.Tests namespace Dapper.Tests
{ {
public partial class DataReaderTests : TestBase public class DataReaderTests : TestBase
{
[Collection("QueryCacheTests")]
public class DataReaderQueryCacheTests : TestBase
{ {
[Fact] [Fact]
public void GetSameReaderForSameShape() public void GetSameReaderForSameShape()
...@@ -40,7 +37,6 @@ public void GetSameReaderForSameShape() ...@@ -40,7 +37,6 @@ public void GetSameReaderForSameShape()
ReferenceEquals(origParser, secondParser).IsEqualTo(true); ReferenceEquals(origParser, secondParser).IsEqualTo(true);
ReferenceEquals(secondParser, thirdParser).IsEqualTo(false); ReferenceEquals(secondParser, thirdParser).IsEqualTo(false);
} }
}
[Fact] [Fact]
public void DiscriminatedUnion() public void DiscriminatedUnion()
...@@ -141,18 +137,13 @@ private abstract class Discriminated_BaseType ...@@ -141,18 +137,13 @@ private abstract class Discriminated_BaseType
private class Discriminated_Foo : Discriminated_BaseType private class Discriminated_Foo : Discriminated_BaseType
{ {
public string Name { get; set; } public string Name { get; set; }
public override int Type { public override int Type => 1;
get { return 1; }
}
} }
private class Discriminated_Bar : Discriminated_BaseType private class Discriminated_Bar : Discriminated_BaseType
{ {
public float Value { get; set; } public float Value { get; set; }
public override int Type public override int Type => 2;
{
get { return 2; }
}
} }
private abstract class DiscriminatedWithMultiMapping_BaseType : Discriminated_BaseType private abstract class DiscriminatedWithMultiMapping_BaseType : Discriminated_BaseType
...@@ -164,20 +155,14 @@ private class DiscriminatedWithMultiMapping_Foo : DiscriminatedWithMultiMapping_ ...@@ -164,20 +155,14 @@ private class DiscriminatedWithMultiMapping_Foo : DiscriminatedWithMultiMapping_
{ {
public override HazNameId HazNameIdObject { get; set; } public override HazNameId HazNameIdObject { get; set; }
public string Name { get; set; } public string Name { get; set; }
public override int Type public override int Type => 1;
{
get { return 1; }
}
} }
private class DiscriminatedWithMultiMapping_Bar : DiscriminatedWithMultiMapping_BaseType private class DiscriminatedWithMultiMapping_Bar : DiscriminatedWithMultiMapping_BaseType
{ {
public override HazNameId HazNameIdObject { get; set; } public override HazNameId HazNameIdObject { get; set; }
public float Value { get; set; } public float Value { get; set; }
public override int Type public override int Type => 2;
{
get { return 2; }
}
} }
} }
} }
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
using System.Linq; using System.Linq;
namespace Dapper.Tests namespace Dapper.Tests
{ {
[Collection("QueryCacheTests")] [Collection(NonParallelDefinition.Name)]
public class NullTests : TestBase public class NullTests : TestBase
{ {
[Fact] [Fact]
......
...@@ -8,11 +8,8 @@ ...@@ -8,11 +8,8 @@
namespace Dapper.Tests namespace Dapper.Tests
{ {
[Collection("TypeHandlerTests")] [Collection(NonParallelDefinition.Name)]
public class TypeHandlerTests : TestBase public class TypeHandlerTests : TestBase
{
[Collection("QueryCacheTests")]
public class TypeHandlerQueryCacheTests : TestBase
{ {
[Fact] [Fact]
public void TestChangingDefaultStringTypeMappingToAnsiString() public void TestChangingDefaultStringTypeMappingToAnsiString()
...@@ -96,7 +93,6 @@ public class TypeWithMapping ...@@ -96,7 +93,6 @@ public class TypeWithMapping
[Description("A")] [Description("A")]
public string B { get; set; } public string B { get; set; }
} }
}
[Fact] [Fact]
public void Issue136_ValueTypeHandlers() public void Issue136_ValueTypeHandlers()
...@@ -512,7 +508,7 @@ public void Test_RemoveTypeMap() ...@@ -512,7 +508,7 @@ public void Test_RemoveTypeMap()
try try
{ {
connection.Execute(@"INSERT INTO #Test_RemoveTypeMap VALUES (@Now)", new { DateTime.Now }); connection.Execute("INSERT INTO #Test_RemoveTypeMap VALUES (@Now)", new { DateTime.Now });
connection.Query<DateTime>("SELECT * FROM #Test_RemoveTypeMap"); connection.Query<DateTime>("SELECT * FROM #Test_RemoveTypeMap");
dateTimeHandler.ParseWasCalled.IsTrue(); dateTimeHandler.ParseWasCalled.IsTrue();
...@@ -639,7 +635,7 @@ public void Issue149_TypeMismatch_SequentialAccess() ...@@ -639,7 +635,7 @@ public void Issue149_TypeMismatch_SequentialAccess()
Guid guid = Guid.Parse("cf0ef7ac-b6fe-4e24-aeda-a2b45bb5654e"); Guid guid = Guid.Parse("cf0ef7ac-b6fe-4e24-aeda-a2b45bb5654e");
try try
{ {
var result = connection.Query<Issue149_Person>(@"select @guid as Id", new { guid }).First(); var result = connection.Query<Issue149_Person>("select @guid as Id", new { guid }).First();
error = null; error = null;
} }
catch (Exception ex) catch (Exception ex)
......
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