Skip to content

Commit 6d66fe4

Browse files
committed
tests
1 parent 5408f9b commit 6d66fe4

5 files changed

Lines changed: 5 additions & 25 deletions

File tree

end2end/EndToEndScaffold/Templates/MySqlTests.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -529,17 +529,13 @@ public async Task TestBinaryCopyFrom(
529529
[Test]
530530
public async Task TestMySqlTransaction()
531531
{
532-
var connection = new MySqlConnector.MySqlConnection(Environment.GetEnvironmentVariable(EndToEndCommon.MySqlConnectionStringEnv)!);
532+
var connection = new MySqlConnector.MySqlConnection(Environment.GetEnvironmentVariable(EndToEndCommon.MySqlConnectionStringEnv));
533533
await connection.OpenAsync();
534534
var transaction = connection.BeginTransaction();
535535
536536
var sqlQueryWithTx = new QuerySql(transaction);
537537
await sqlQueryWithTx.CreateAuthor(new QuerySql.CreateAuthorArgs { Id = 1111, Name = "Bojack Horseman", Bio = "Back in the 90s he was in a very famous TV show" });
538538
539-
// The GetAuthor method in MySqlConnectorExampleGen (non-Dapper) returns QuerySql.GetAuthorRow (non-nullable struct/record)
540-
// if it were a non-nullable struct/record, actualNull == null would always be false.
541-
// However, MySqlConnectorTester.generated.cs uses actual.Value, implying it's nullable.
542-
// Let's assume QuerySql.GetAuthor returns QuerySql.GetAuthorRow? (nullable record struct) for MySqlConnectorExampleGen.
543539
var actualNull = await this.QuerySql.GetAuthor(new QuerySql.GetAuthorArgs { Name = "Bojack Horseman" });
544540
Assert.That(actualNull == null, "there is author"); // This is correct for nullable types
545541

end2end/EndToEndTests/MySqlConnectorDapperTester.generated.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,15 +364,11 @@ public async Task TestMySqlIntegerTypes(bool? cBool, bool? cBoolean, short? cTin
364364
[Test]
365365
public async Task TestMySqlTransaction()
366366
{
367-
var connection = new MySqlConnector.MySqlConnection(Environment.GetEnvironmentVariable(EndToEndCommon.MySqlConnectionStringEnv)!);
367+
var connection = new MySqlConnector.MySqlConnection(Environment.GetEnvironmentVariable(EndToEndCommon.MySqlConnectionStringEnv));
368368
await connection.OpenAsync();
369369
var transaction = connection.BeginTransaction();
370370
var sqlQueryWithTx = new QuerySql(transaction);
371371
await sqlQueryWithTx.CreateAuthor(new QuerySql.CreateAuthorArgs { Id = 1111, Name = "Bojack Horseman", Bio = "Back in the 90s he was in a very famous TV show" });
372-
// The GetAuthor method in MySqlConnectorExampleGen (non-Dapper) returns QuerySql.GetAuthorRow (non-nullable struct/record)
373-
// if it were a non-nullable struct/record, actualNull == null would always be false.
374-
// However, MySqlConnectorTester.generated.cs uses actual.Value, implying it's nullable.
375-
// Let's assume QuerySql.GetAuthor returns QuerySql.GetAuthorRow? (nullable record struct) for MySqlConnectorExampleGen.
376372
var actualNull = await this.QuerySql.GetAuthor(new QuerySql.GetAuthorArgs { Name = "Bojack Horseman" });
377373
Assert.That(actualNull == null, "there is author"); // This is correct for nullable types
378374
await transaction.CommitAsync();

end2end/EndToEndTests/MySqlConnectorTester.generated.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,15 +364,11 @@ public async Task TestMySqlIntegerTypes(bool? cBool, bool? cBoolean, short? cTin
364364
[Test]
365365
public async Task TestMySqlTransaction()
366366
{
367-
var connection = new MySqlConnector.MySqlConnection(Environment.GetEnvironmentVariable(EndToEndCommon.MySqlConnectionStringEnv)!);
367+
var connection = new MySqlConnector.MySqlConnection(Environment.GetEnvironmentVariable(EndToEndCommon.MySqlConnectionStringEnv));
368368
await connection.OpenAsync();
369369
var transaction = connection.BeginTransaction();
370370
var sqlQueryWithTx = new QuerySql(transaction);
371371
await sqlQueryWithTx.CreateAuthor(new QuerySql.CreateAuthorArgs { Id = 1111, Name = "Bojack Horseman", Bio = "Back in the 90s he was in a very famous TV show" });
372-
// The GetAuthor method in MySqlConnectorExampleGen (non-Dapper) returns QuerySql.GetAuthorRow (non-nullable struct/record)
373-
// if it were a non-nullable struct/record, actualNull == null would always be false.
374-
// However, MySqlConnectorTester.generated.cs uses actual.Value, implying it's nullable.
375-
// Let's assume QuerySql.GetAuthor returns QuerySql.GetAuthorRow? (nullable record struct) for MySqlConnectorExampleGen.
376372
var actualNull = await this.QuerySql.GetAuthor(new QuerySql.GetAuthorArgs { Name = "Bojack Horseman" });
377373
Assert.That(actualNull == null, "there is author"); // This is correct for nullable types
378374
await transaction.CommitAsync();

end2end/EndToEndTestsLegacy/MySqlConnectorDapperTester.generated.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,15 +364,11 @@ public async Task TestMySqlIntegerTypes(bool? cBool, bool? cBoolean, short? cTin
364364
[Test]
365365
public async Task TestMySqlTransaction()
366366
{
367-
var connection = new MySqlConnector.MySqlConnection(Environment.GetEnvironmentVariable(EndToEndCommon.MySqlConnectionStringEnv)!);
367+
var connection = new MySqlConnector.MySqlConnection(Environment.GetEnvironmentVariable(EndToEndCommon.MySqlConnectionStringEnv));
368368
await connection.OpenAsync();
369369
var transaction = connection.BeginTransaction();
370370
var sqlQueryWithTx = new QuerySql(transaction);
371371
await sqlQueryWithTx.CreateAuthor(new QuerySql.CreateAuthorArgs { Id = 1111, Name = "Bojack Horseman", Bio = "Back in the 90s he was in a very famous TV show" });
372-
// The GetAuthor method in MySqlConnectorExampleGen (non-Dapper) returns QuerySql.GetAuthorRow (non-nullable struct/record)
373-
// if it were a non-nullable struct/record, actualNull == null would always be false.
374-
// However, MySqlConnectorTester.generated.cs uses actual.Value, implying it's nullable.
375-
// Let's assume QuerySql.GetAuthor returns QuerySql.GetAuthorRow? (nullable record struct) for MySqlConnectorExampleGen.
376372
var actualNull = await this.QuerySql.GetAuthor(new QuerySql.GetAuthorArgs { Name = "Bojack Horseman" });
377373
Assert.That(actualNull == null, "there is author"); // This is correct for nullable types
378374
await transaction.CommitAsync();

end2end/EndToEndTestsLegacy/MySqlConnectorTester.generated.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,15 +364,11 @@ public async Task TestMySqlIntegerTypes(bool? cBool, bool? cBoolean, short? cTin
364364
[Test]
365365
public async Task TestMySqlTransaction()
366366
{
367-
var connection = new MySqlConnector.MySqlConnection(Environment.GetEnvironmentVariable(EndToEndCommon.MySqlConnectionStringEnv)!);
367+
var connection = new MySqlConnector.MySqlConnection(Environment.GetEnvironmentVariable(EndToEndCommon.MySqlConnectionStringEnv));
368368
await connection.OpenAsync();
369369
var transaction = connection.BeginTransaction();
370370
var sqlQueryWithTx = new QuerySql(transaction);
371371
await sqlQueryWithTx.CreateAuthor(new QuerySql.CreateAuthorArgs { Id = 1111, Name = "Bojack Horseman", Bio = "Back in the 90s he was in a very famous TV show" });
372-
// The GetAuthor method in MySqlConnectorExampleGen (non-Dapper) returns QuerySql.GetAuthorRow (non-nullable struct/record)
373-
// if it were a non-nullable struct/record, actualNull == null would always be false.
374-
// However, MySqlConnectorTester.generated.cs uses actual.Value, implying it's nullable.
375-
// Let's assume QuerySql.GetAuthor returns QuerySql.GetAuthorRow? (nullable record struct) for MySqlConnectorExampleGen.
376372
var actualNull = await this.QuerySql.GetAuthor(new QuerySql.GetAuthorArgs { Name = "Bojack Horseman" });
377373
Assert.That(actualNull == null, "there is author"); // This is correct for nullable types
378374
await transaction.CommitAsync();

0 commit comments

Comments
 (0)