Skip to content
Permalink
Browse files

Format all the things

  • Loading branch information...
pleb committed Mar 27, 2019
1 parent c141b45 commit 2d0bc1b9f40119a50f149bb4e35ac43486327fa8
Showing with 349 additions and 1,437 deletions.
  1. +1 −7 PetaPoco.Tests.Integration/Databases/BaseDatabase.cs
  2. +1 −2 PetaPoco.Tests.Integration/Databases/BaseDatabaseTests.cs
  3. +1 −7 PetaPoco.Tests.Integration/Databases/BaseDeleteTests.cs
  4. +6 −19 PetaPoco.Tests.Integration/Databases/BaseInsertTests.cs
  5. +2 −3 PetaPoco.Tests.Integration/Databases/BaseQueryLinqTests.cs
  6. +27 −27 PetaPoco.Tests.Integration/Databases/BaseQueryTests.cs
  7. +5 −12 PetaPoco.Tests.Integration/Databases/BaseUpdateTests.cs
  8. +1 −6 PetaPoco.Tests.Integration/Databases/DBTestProvider.cs
  9. +0 −6 PetaPoco.Tests.Integration/Databases/Firebird/FirebirdDBTestProvider.cs
  10. +0 −6 PetaPoco.Tests.Integration/Databases/Firebird/FirebirdDatabaseTests.cs
  11. +0 −6 PetaPoco.Tests.Integration/Databases/Firebird/FirebirdDeleteTests.cs
  12. +1 −7 PetaPoco.Tests.Integration/Databases/Firebird/FirebirdExecuteTests.cs
  13. +1 −7 PetaPoco.Tests.Integration/Databases/Firebird/FirebirdInsertTests.cs
  14. +1 −7 PetaPoco.Tests.Integration/Databases/Firebird/FirebirdQueryLinqTests.cs
  15. +1 −7 PetaPoco.Tests.Integration/Databases/Firebird/FirebirdQueryTests.cs
  16. +6 −13 PetaPoco.Tests.Integration/Databases/Firebird/FirebirdStoredProcTests.cs
  17. +0 −6 PetaPoco.Tests.Integration/Databases/Firebird/FirebirdUpdateTests.cs
  18. +0 −6 PetaPoco.Tests.Integration/Databases/MSAccess/MsAccessDBTestProvider.cs
  19. +0 −6 PetaPoco.Tests.Integration/Databases/MSAccess/MsAccessDatabaseTests.cs
  20. +0 −6 PetaPoco.Tests.Integration/Databases/MSAccess/MsAccessDeleteTests.cs
  21. +0 −6 PetaPoco.Tests.Integration/Databases/MSAccess/MsAccessExecuteTests.cs
  22. +0 −6 PetaPoco.Tests.Integration/Databases/MSAccess/MsAccessInsertTests.cs
  23. +0 −6 PetaPoco.Tests.Integration/Databases/MSAccess/MsAccessQueryLinqTests.cs
  24. +2 −11 PetaPoco.Tests.Integration/Databases/MSAccess/MsAccessQueryTests.cs
  25. +0 −6 PetaPoco.Tests.Integration/Databases/MSAccess/MsAccessUpdateTests.cs
  26. +0 −6 PetaPoco.Tests.Integration/Databases/MSSQL/MssqlDBTestProvider.cs
  27. +0 −6 PetaPoco.Tests.Integration/Databases/MSSQL/MssqlDatabaseTests.cs
  28. +0 −6 PetaPoco.Tests.Integration/Databases/MSSQL/MssqlDeleteTests.cs
  29. +1 −7 PetaPoco.Tests.Integration/Databases/MSSQL/MssqlExecuteTests.cs
  30. +1 −7 PetaPoco.Tests.Integration/Databases/MSSQL/MssqlInsertTests.cs
  31. +1 −7 PetaPoco.Tests.Integration/Databases/MSSQL/MssqlQueryLinqTests.cs
  32. +3 −11 PetaPoco.Tests.Integration/Databases/MSSQL/MssqlQueryTests.cs
  33. +5 −11 PetaPoco.Tests.Integration/Databases/MSSQL/MssqlStoredProcTests.cs
  34. +0 −6 PetaPoco.Tests.Integration/Databases/MSSQL/MssqlUpdateTests.cs
  35. +7 −15 PetaPoco.Tests.Integration/Databases/MSSQLCe/MssqlCeDBTestProvider.cs
  36. +0 −6 PetaPoco.Tests.Integration/Databases/MSSQLCe/MssqlCeDatabaseTests.cs
  37. +0 −6 PetaPoco.Tests.Integration/Databases/MSSQLCe/MssqlCeDeleteTests.cs
  38. +1 −7 PetaPoco.Tests.Integration/Databases/MSSQLCe/MssqlCeExecuteTests.cs
  39. +1 −7 PetaPoco.Tests.Integration/Databases/MSSQLCe/MssqlCeInsertTests.cs
  40. +1 −7 PetaPoco.Tests.Integration/Databases/MSSQLCe/MssqlCeQueryLinqTests.cs
  41. +1 −7 PetaPoco.Tests.Integration/Databases/MSSQLCe/MssqlCeQueryTests.cs
  42. +0 −6 PetaPoco.Tests.Integration/Databases/MSSQLCe/MssqlCeUpdateTests.cs
  43. +0 −6 PetaPoco.Tests.Integration/Databases/MariaDb/MariaDbDBTestProvider.cs
  44. +0 −6 PetaPoco.Tests.Integration/Databases/MariaDb/MariaDbDatabaseTests.cs
  45. +0 −6 PetaPoco.Tests.Integration/Databases/MariaDb/MariaDbDeleteTests.cs
  46. +0 −6 PetaPoco.Tests.Integration/Databases/MariaDb/MariaDbExecuteTests.cs
  47. +1 −7 PetaPoco.Tests.Integration/Databases/MariaDb/MariaDbInsertTests.cs
  48. +1 −7 PetaPoco.Tests.Integration/Databases/MariaDb/MariaDbQueryLinqTests.cs
  49. +5 −11 PetaPoco.Tests.Integration/Databases/MariaDb/MariaDbStoredProcTests.cs
  50. +0 −6 PetaPoco.Tests.Integration/Databases/MariaDb/MariaDbUpdateTests.cs
  51. +1 −7 PetaPoco.Tests.Integration/Databases/MariaDb/MariaQueryTests.cs
  52. +0 −6 PetaPoco.Tests.Integration/Databases/MySQL/MySqlDBTestProvider.cs
  53. +0 −6 PetaPoco.Tests.Integration/Databases/MySQL/MySqlDatabaseTests.cs
  54. +0 −6 PetaPoco.Tests.Integration/Databases/MySQL/MySqlDeleteTests.cs
  55. +0 −6 PetaPoco.Tests.Integration/Databases/MySQL/MySqlExecuteTests.cs
  56. +1 −7 PetaPoco.Tests.Integration/Databases/MySQL/MySqlInsertTests.cs
  57. +1 −7 PetaPoco.Tests.Integration/Databases/MySQL/MySqlMiscellaneousTests.cs
  58. +1 −7 PetaPoco.Tests.Integration/Databases/MySQL/MySqlQueryLinqTests.cs
  59. +1 −7 PetaPoco.Tests.Integration/Databases/MySQL/MySqlQueryTests.cs
  60. +5 −11 PetaPoco.Tests.Integration/Databases/MySQL/MySqlStoredProcTests.cs
  61. +0 −6 PetaPoco.Tests.Integration/Databases/MySQL/MySqlUpdateTests.cs
  62. +0 −6 PetaPoco.Tests.Integration/Databases/Postgres/PostgresDBTestProvider.cs
  63. +0 −6 PetaPoco.Tests.Integration/Databases/Postgres/PostgresDeleteTests.cs
  64. +1 −7 PetaPoco.Tests.Integration/Databases/Postgres/PostgresExecuteTests.cs
  65. +1 −7 PetaPoco.Tests.Integration/Databases/Postgres/PostgresInsertTests.cs
  66. +1 −7 PetaPoco.Tests.Integration/Databases/Postgres/PostgresQueryLinqTests.cs
  67. +1 −7 PetaPoco.Tests.Integration/Databases/Postgres/PostgresQueryTests.cs
  68. +0 −6 PetaPoco.Tests.Integration/Databases/Postgres/PostgresUpdateTests.cs
  69. +2 −12 PetaPoco.Tests.Integration/Databases/Sqlite/SqliteDBTestProvider.cs
  70. +0 −6 PetaPoco.Tests.Integration/Databases/Sqlite/SqliteDatabaseTests.cs
  71. +0 −6 PetaPoco.Tests.Integration/Databases/Sqlite/SqliteDeleteTests.cs
  72. +1 −7 PetaPoco.Tests.Integration/Databases/Sqlite/SqliteExecuteTests.cs
  73. +1 −7 PetaPoco.Tests.Integration/Databases/Sqlite/SqliteInsertTests.cs
  74. +1 −7 PetaPoco.Tests.Integration/Databases/Sqlite/SqliteQueryLinqTests.cs
  75. +1 −7 PetaPoco.Tests.Integration/Databases/Sqlite/SqliteQueryTests.cs
  76. +0 −6 PetaPoco.Tests.Integration/Databases/Sqlite/SqliteUpdateTests.cs
  77. +1 −7 PetaPoco.Tests.Integration/Documentation/Inserts.cs
  78. +4 −9 PetaPoco.Tests.Integration/Documentation/Updates.cs
  79. +1 −7 PetaPoco.Tests.Integration/Models/Note.cs
  80. +1 −7 PetaPoco.Tests.Integration/Models/NoteNullablePrimary.cs
  81. +1 −7 PetaPoco.Tests.Integration/Models/Order.cs
  82. +1 −7 PetaPoco.Tests.Integration/Models/OrderLine.cs
  83. +1 −7 PetaPoco.Tests.Integration/Models/OrderLineStatus.cs
  84. +1 −7 PetaPoco.Tests.Integration/Models/OrderStatus.cs
  85. +1 −7 PetaPoco.Tests.Integration/Models/Person.cs
  86. +1 −7 PetaPoco.Tests.Integration/Models/Postgres/JsonTypesPoco.cs
  87. +1 −7 PetaPoco.Tests.Integration/Models/TransactionLog.cs
  88. +2 −1 PetaPoco.Tests.Integration/TypeExtensions.cs
  89. +0 −6 PetaPoco.Tests.Unit/Core/ConventionMapperRegressionTests.cs
  90. +1 −7 PetaPoco.Tests.Unit/Core/ConventionMapperTests.cs
  91. +1 −7 PetaPoco.Tests.Unit/Core/Inflection/EnglishInflectorTests.cs
  92. +1 −7 PetaPoco.Tests.Unit/Core/Inflection/InflectorTests.cs
  93. +17 −21 PetaPoco.Tests.Unit/Core/PocoDataTests.cs
  94. +14 −39 PetaPoco.Tests.Unit/Core/SqlTests.cs
  95. +1 −7 PetaPoco.Tests.Unit/Core/StandardMapperTests.cs
  96. +66 −59 PetaPoco.Tests.Unit/CreateCommandTests.cs
  97. +25 −111 PetaPoco.Tests.Unit/DatabaseConfigurationTests.cs
  98. +7 −5 PetaPoco.Tests.Unit/DatabaseTests.cs
  99. +1 −7 PetaPoco.Tests.Unit/Models/Note.cs
  100. +1 −7 PetaPoco.Tests.Unit/Models/Order.cs
  101. +1 −7 PetaPoco.Tests.Unit/Models/OrderLine.cs
  102. +1 −7 PetaPoco.Tests.Unit/Models/OrderStatus.cs
  103. +1 −7 PetaPoco.Tests.Unit/Models/Person.cs
  104. +1 −7 PetaPoco.Tests.Unit/Models/TransactionLog.cs
  105. +1 −7 PetaPoco.Tests.Unit/Providers/CustomProviderRegistrationTests.cs
  106. +1 −7 PetaPoco.Tests.Unit/Providers/SqlServerDatabaseProviderTests.cs
  107. +4 −9 PetaPoco.Tests.Unit/Utilities/ParametersHelperTests.cs
  108. +83 −459 PetaPoco/Database.cs
@@ -1,10 +1,4 @@
// <copyright company="PetaPoco - CollaboratingPlatypus">
// Apache License, Version 2.0 https://github.com/CollaboratingPlatypus/PetaPoco/blob/master/LICENSE.txt
// </copyright>
// <author>PetaPoco - CollaboratingPlatypus</author>
// <date>2018/07/02</date>

using System;
using System;

namespace PetaPoco.Tests.Integration.Databases
{
@@ -83,8 +83,7 @@ public void Construct_GivenConnectionStringAndProviderFactory_ShouldBeValid()
public void Construct_GivenConnectionStringName_ShouldBeValid()
{
var connectionString = DB.ConnectionString;
var entry = ConfigurationManager.ConnectionStrings.Cast<ConnectionStringSettings>().FirstOrDefault(c =>
c.ConnectionString.Equals(connectionString));
var entry = ConfigurationManager.ConnectionStrings.Cast<ConnectionStringSettings>().FirstOrDefault(c => c.ConnectionString.Equals(connectionString));

using (var db = new Database(entry.Name))
{
@@ -1,10 +1,4 @@
// <copyright company="PetaPoco - CollaboratingPlatypus">
// Apache License, Version 2.0 https://github.com/CollaboratingPlatypus/PetaPoco/blob/master/LICENSE.txt
// </copyright>
// <author>PetaPoco - CollaboratingPlatypus</author>
// <date>2018/07/02</date>

using System;
using System;
using PetaPoco.Tests.Integration.Models;
using Shouldly;
using Xunit;
@@ -1,10 +1,4 @@
// <copyright company="PetaPoco - CollaboratingPlatypus">
// Apache License, Version 2.0 https://github.com/CollaboratingPlatypus/PetaPoco/blob/master/LICENSE.txt
// </copyright>
// <author>PetaPoco - CollaboratingPlatypus</author>
// <date>2018/07/02</date>

using System;
using System;
using PetaPoco.Tests.Integration.Models;
using Shouldly;
using Xunit;
@@ -86,9 +80,7 @@ public void Insert_GivenPocoTableNameAndColumnName_ShouldInsertPoco()
{
DB.Insert("SpecificPeople", "Id", false, _person);

var personOther =
DB.Single<Person>($"SELECT * From {DB.Provider.EscapeTableName("SpecificPeople")} WHERE {DB.Provider.EscapeSqlIdentifier("Id")} = @0",
_person.Id);
var personOther = DB.Single<Person>($"SELECT * From {DB.Provider.EscapeTableName("SpecificPeople")} WHERE {DB.Provider.EscapeSqlIdentifier("Id")} = @0", _person.Id);

personOther.ShouldNotBeNull();
personOther.ShouldBe(_person);
@@ -103,15 +95,10 @@ public void Insert_WhenInsertingRelatedPocosGivenPocoTableNameAndColumnName_Shou
_orderLine.OrderId = _order.Id;
DB.Insert("SpecificOrderLines", "Id", _orderLine);

var personOther =
DB.Single<Person>($"SELECT * FROM {DB.Provider.EscapeTableName("SpecificPeople")} WHERE {DB.Provider.EscapeSqlIdentifier("Id")} = @0",
_person.Id);
var orderOther =
DB.Single<Order>($"SELECT * FROM {DB.Provider.EscapeTableName("SpecificOrders")} WHERE {DB.Provider.EscapeSqlIdentifier("Id")} = @0",
_order.Id);
var orderLineOther =
DB.Single<OrderLine>($"SELECT * FROM {DB.Provider.EscapeTableName("SpecificOrderLines")} WHERE {DB.Provider.EscapeSqlIdentifier("Id")} = @0",
_orderLine.Id);
var personOther = DB.Single<Person>($"SELECT * FROM {DB.Provider.EscapeTableName("SpecificPeople")} WHERE {DB.Provider.EscapeSqlIdentifier("Id")} = @0", _person.Id);
var orderOther = DB.Single<Order>($"SELECT * FROM {DB.Provider.EscapeTableName("SpecificOrders")} WHERE {DB.Provider.EscapeSqlIdentifier("Id")} = @0", _order.Id);
var orderLineOther = DB.Single<OrderLine>($"SELECT * FROM {DB.Provider.EscapeTableName("SpecificOrderLines")} WHERE {DB.Provider.EscapeSqlIdentifier("Id")} = @0",
_orderLine.Id);

personOther.ShouldNotBeNull();
personOther.ShouldBe(_person);
@@ -337,8 +337,7 @@ public async void ExistsAsync_GivenSqlStringMatchingNoRecord_ShouldBeFalse()
{
(await DB.ExistsAsync<Person>($"WHERE {DB.Provider.EscapeSqlIdentifier("Age")} = @0", 18)).ShouldBeFalse();
}



[Fact]
public async void SingleAsync_GivenPrimaryKeyMatchingOneRecord_ShouldReturnPoco()
{
@@ -475,7 +474,7 @@ public async void FirstAsync_GivenSqlStringAndMatchingTwoRecords_ShouldReturnFir
}

[Fact]
public void FirstAsync_GivenSqlStringMatchingNoRecord_ShouldThrow()
public void FirstAsync_GivenSqlStringMatchingNoRecord_ShouldThrow()
{
Should.Throw<Exception>(DB.FirstAsync<Person>($"WHERE {DB.Provider.EscapeSqlIdentifier("Age")} = @0", 18));
}
@@ -111,7 +111,7 @@ public void Query_ForDynamicTypeGivenSql_ShouldReturnValidDynamicTypeCollection(
var pd = PocoData.ForType(typeof(Order), DB.DefaultMapper);
var sql = new Sql(
$"SELECT * FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)} " +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);

var results = DB.Query<dynamic>(sql).ToArray();
results.Length.ShouldBe(3);
@@ -212,8 +212,8 @@ public void Query_ForValueTypeGivenSql_ShouldReturnValidValueTypeCollection()
var pd = PocoData.ForType(typeof(Order), DB.DefaultMapper);
var sql = new Sql(
$"SELECT {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "PoNumber").ColumnName)} " +
$"FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)}" +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);
$"FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)}" +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);

var results = DB.Query<string>(sql).ToList();
results.Count.ShouldBe(3);
@@ -249,7 +249,7 @@ public async void QueryAsync_ForDynamicTypeGivenSql_ShouldReturnValidDynamicType
var pd = PocoData.ForType(typeof(Order), DB.DefaultMapper);
var sql = new Sql(
$"SELECT * FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)} " +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);

var results = new List<dynamic>();
await DB.QueryAsync<dynamic>(p => results.Add(p), sql);
@@ -356,8 +356,8 @@ public async void QueryAsync_ForValueTypeGivenSql_ShouldReturnValidValueTypeColl
var pd = PocoData.ForType(typeof(Order), DB.DefaultMapper);
var sql = new Sql(
$"SELECT {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "PoNumber").ColumnName)} " +
$"FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)}" +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);
$"FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)}" +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);

var results = new List<string>();
await DB.QueryAsync<string>(p => results.Add(p), sql);
@@ -396,7 +396,7 @@ public async void QueryAsyncReader_ForDynamicTypeGivenSql_ShouldReturnValidDynam
var pd = PocoData.ForType(typeof(Order), DB.DefaultMapper);
var sql = new Sql(
$"SELECT * FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)} " +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);

var results = new List<dynamic>();
using (var asyncReader = await DB.QueryAsync<dynamic>(sql))
@@ -516,8 +516,8 @@ public async void QueryAsyncReader_ForValueTypeGivenSql_ShouldReturnValidValueTy
var pd = PocoData.ForType(typeof(Order), DB.DefaultMapper);
var sql = new Sql(
$"SELECT {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "PoNumber").ColumnName)} " +
$"FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)}" +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);
$"FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)}" +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);

var results = new List<string>();
using (var asyncReader = await DB.QueryAsync<string>(sql))
@@ -556,7 +556,7 @@ public void Fetch_ForDynamicTypeGivenSql_ShouldReturnValidDynamicTypeCollection(
var pd = PocoData.ForType(typeof(Order), DB.DefaultMapper);
var sql = new Sql(
$"SELECT * FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)} " +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);

var results = DB.Fetch<dynamic>(sql);
results.Count.ShouldBe(3);
@@ -657,8 +657,8 @@ public void Fetch_ForValueTypeGivenSql_ShouldReturnValidValueTypeCollection()
var pd = PocoData.ForType(typeof(Order), DB.DefaultMapper);
var sql = new Sql(
$"SELECT {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "PoNumber").ColumnName)} " +
$"FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)}" +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);
$"FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)}" +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);

var results = DB.Fetch<string>(sql);
results.Count.ShouldBe(3);
@@ -684,7 +684,7 @@ public void SkipAndTake_ForDynamicTypeGivenSql_ShouldReturnValidDynamicTypeColle
var pd = PocoData.ForType(typeof(Order), DB.DefaultMapper);
var sql = new Sql(
$"SELECT * FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)} " +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);

var results = DB.SkipTake<dynamic>(2, 1, sql);
results.Count.ShouldBe(1);
@@ -748,8 +748,8 @@ public void SkipAndTake_ForValueTypeGivenSql_ShouldReturnValidValueTypeCollectio
var pd = PocoData.ForType(typeof(Order), DB.DefaultMapper);
var sql = new Sql(
$"SELECT {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "PoNumber").ColumnName)} " +
$"FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)}" +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);
$"FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)}" +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);

var results = DB.SkipTake<string>(2, 1, sql);
results.Count.ShouldBe(1);
@@ -774,7 +774,7 @@ public void FetchWithPaging_ForDynamicTypeGivenSql_ShouldReturnValidDynamicTypeC
var pd = PocoData.ForType(typeof(Order), DB.DefaultMapper);
var sql = new Sql(
$"SELECT * FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)} " +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);

var results = DB.Fetch<dynamic>(2, 1, sql);
results.Count.ShouldBe(1);
@@ -838,8 +838,8 @@ public void FetchWithPaging_ForValueTypeGivenSql_ShouldReturnValidValueTypeColle
var pd = PocoData.ForType(typeof(Order), DB.DefaultMapper);
var sql = new Sql(
$"SELECT {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "PoNumber").ColumnName)} " +
$"FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)}" +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);
$"FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)}" +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);

var results = DB.Fetch<string>(2, 1, sql);
results.Count.ShouldBe(1);
@@ -873,7 +873,7 @@ public async void FetchAsync_ForDynamicTypeGivenSql_ShouldReturnValidDynamicType
var pd = PocoData.ForType(typeof(Order), DB.DefaultMapper);
var sql = new Sql(
$"SELECT * FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)} " +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);

var results = await DB.FetchAsync<dynamic>(sql);
results.Count.ShouldBe(3);
@@ -974,8 +974,8 @@ public async void FetchAsync_ForValueTypeGivenSql_ShouldReturnValidValueTypeColl
var pd = PocoData.ForType(typeof(Order), DB.DefaultMapper);
var sql = new Sql(
$"SELECT {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "PoNumber").ColumnName)} " +
$"FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)}" +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);
$"FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)}" +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);

var results = await DB.FetchAsync<string>(sql);
results.Count.ShouldBe(3);
@@ -1001,7 +1001,7 @@ public async void FetchAsyncWithPaging_ForDynamicTypeGivenSql_ShouldReturnValidD
var pd = PocoData.ForType(typeof(Order), DB.DefaultMapper);
var sql = new Sql(
$"SELECT * FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)} " +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);

var results = await DB.FetchAsync<dynamic>(2, 1, sql);
results.Count.ShouldBe(1);
@@ -1065,8 +1065,8 @@ public async void FetchAsyncWithPaging_ForValueTypeGivenSql_ShouldReturnValidVal
var pd = PocoData.ForType(typeof(Order), DB.DefaultMapper);
var sql = new Sql(
$"SELECT {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "PoNumber").ColumnName)} " +
$"FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)}" +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);
$"FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)}" +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);

var results = await DB.FetchAsync<string>(2, 1, sql);
results.Count.ShouldBe(1);
@@ -1091,7 +1091,7 @@ public async void SkipAndTakeAsync_ForDynamicTypeGivenSql_ShouldReturnValidDynam
var pd = PocoData.ForType(typeof(Order), DB.DefaultMapper);
var sql = new Sql(
$"SELECT * FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)} " +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);

var results = await DB.SkipTakeAsync<dynamic>(2, 1, sql);
results.Count.ShouldBe(1);
@@ -1155,8 +1155,8 @@ public async void SkipAndTakeAsync_ForValueTypeGivenSql_ShouldReturnValidValueTy
var pd = PocoData.ForType(typeof(Order), DB.DefaultMapper);
var sql = new Sql(
$"SELECT {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "PoNumber").ColumnName)} " +
$"FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)}" +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);
$"FROM {DB.Provider.EscapeTableName(pd.TableInfo.TableName)}" +
$"WHERE {DB.Provider.EscapeSqlIdentifier(pd.Columns.Values.First(c => c.PropertyInfo.Name == "Status").ColumnName)} = @0", OrderStatus.Pending);

var results = await DB.SkipTakeAsync<string>(2, 1, sql);
results.Count.ShouldBe(1);
Oops, something went wrong.

0 comments on commit 2d0bc1b

Please sign in to comment.
You can’t perform that action at this time.