Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions Moq.Dapper.Test/DapperQueryAsyncTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ public void QueryAsyncGenericComplexType()
new ComplexType
{
StringProperty = "String1",
StringArrayProperty = ["StringArray1"],
IntegerProperty = 7,
LongProperty = 70,
BigIntegerProperty = 700,
Expand All @@ -219,6 +220,7 @@ public void QueryAsyncGenericComplexType()
new ComplexType
{
StringProperty = "String2",
StringArrayProperty = ["StringArray1", "StringArray2"],
IntegerProperty = 77,
LongProperty = 770,
BigIntegerProperty = 7700,
Expand All @@ -232,6 +234,7 @@ public void QueryAsyncGenericComplexType()
new ComplexType
{
StringProperty = "String3",
StringArrayProperty = ["StringArray1", "StringArray2", "StringArray3"],
IntegerProperty = 777,
LongProperty = 7770,
BigIntegerProperty = 77700,
Expand All @@ -258,6 +261,7 @@ public void QueryAsyncGenericComplexType()
foreach (var complexObject in expected)
{
var match = actual.Where(co => co.StringProperty == complexObject.StringProperty &&
co.StringArrayProperty == complexObject.StringArrayProperty &&
co.IntegerProperty == complexObject.IntegerProperty &&
co.LongProperty == complexObject.LongProperty &&
co.BigIntegerProperty == complexObject.BigIntegerProperty &&
Expand All @@ -279,6 +283,7 @@ public void QuerySingleOrDefaultAsyncWithComplexType()
var expected = new ComplexType
{
StringProperty = "String1",
StringArrayProperty = ["StringArray1", "StringArray2"],
IntegerProperty = 7,
LongProperty = 70,
BigIntegerProperty = 700,
Expand Down Expand Up @@ -323,6 +328,7 @@ public void QueryFirstOrDefaultAsyncWithComplexType()
var expected = new ComplexType
{
StringProperty = "String1",
StringArrayProperty = ["StringArray1", "StringArray2", "StringArray3"],
IntegerProperty = 7,
LongProperty = 70,
BigIntegerProperty = 700,
Expand Down Expand Up @@ -416,6 +422,7 @@ public enum EnumType
public BigInteger BigIntegerProperty { get; set; }
public long LongProperty { get; set; }
public int IntegerProperty { get; set; }
public string[] StringArrayProperty { get; set; }
public string StringProperty { get; set; }
public Guid GuidProperty { get; set; }
public DateTime DateTimeProperty { get; set; }
Expand Down
7 changes: 7 additions & 0 deletions Moq.Dapper.Test/DapperQueryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public void QueryGenericComplexType()
new ComplexType
{
StringProperty = "String1",
StringArrayProperty = ["StringArray1"],
IntegerProperty = 7,
LongProperty = 70,
BigIntegerProperty = 700,
Expand All @@ -128,6 +129,7 @@ public void QueryGenericComplexType()
new ComplexType
{
StringProperty = "String2",
StringArrayProperty = ["StringArray1", "StringArray2"],
IntegerProperty = 77,
LongProperty = 770,
BigIntegerProperty = 7700,
Expand All @@ -141,6 +143,7 @@ public void QueryGenericComplexType()
new ComplexType
{
StringProperty = "String3",
StringArrayProperty = ["StringArray1", "StringArray2", "StringArray3"],
IntegerProperty = 777,
LongProperty = 7770,
BigIntegerProperty = 77700,
Expand All @@ -162,6 +165,7 @@ public void QueryGenericComplexType()
foreach (var complexObject in expected)
{
var match = actual.Where(co => co.StringProperty == complexObject.StringProperty &&
co.StringArrayProperty == complexObject.StringArrayProperty &&
co.IntegerProperty == complexObject.IntegerProperty &&
co.LongProperty == complexObject.LongProperty &&
co.BigIntegerProperty == complexObject.BigIntegerProperty &&
Expand All @@ -184,6 +188,7 @@ public void QuerySingleOrDefaultWithComplexType()
var expected = new ComplexType
{
StringProperty = "String1",
StringArrayProperty = ["StringArray1"],
IntegerProperty = 7,
LongProperty = 70,
BigIntegerProperty = 700,
Expand Down Expand Up @@ -224,6 +229,7 @@ public void QueryFirstOrDefaultWithComplexType()
var expected = new ComplexType
{
StringProperty = "String1",
StringArrayProperty = ["StringArray1"],
IntegerProperty = 7,
LongProperty = 70,
BigIntegerProperty = 700,
Expand Down Expand Up @@ -293,6 +299,7 @@ public enum EnumType
public int IntegerProperty { get; set; }
public long LongProperty { get; set; }
public BigInteger BigIntegerProperty { get; set; }
public string[] StringArrayProperty { get; set; }
public string StringProperty { get; set; }
public Guid GuidProperty { get; set; }
public DateTime DateTimeProperty { get; set; }
Expand Down
1 change: 1 addition & 0 deletions Moq.Dapper/EnumerableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Type GetDataColumnType(Type source) =>
bool IsMatchingType(Type t) =>
t.IsPrimitive ||
t.IsEnum ||
t.IsArray ||
t == typeof(DateTime) ||
t == typeof(DateTimeOffset) ||
t == typeof(decimal) ||
Expand Down