Skip to content

Commit

Permalink
Unify test credentials for MySQL; add passing test for SO36303462
Browse files Browse the repository at this point in the history
  • Loading branch information
mgravell committed Apr 1, 2016
1 parent 2b4bb22 commit 92eca47
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Dapper.Tests.Contrib/TestSuites.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ public class MySqlServerTestSuite : TestSuite
{
const string DbName = "DapperContribTests";

public static string ConnectionString =>
public static string ConnectionString { get; private set; } =
IsAppVeyor
? @"Server=localhost;Uid=root;Pwd=Password12!;"
: $"Server=localhost;Uid=root;Pwd=Password12!;";
? "Server=localhost;Uid=root;Pwd=Password12!;"
: "Server=localhost;Uid=test;Pwd=pass;";

public override IDbConnection GetConnection()
{
Expand Down
24 changes: 24 additions & 0 deletions Dapper.Tests/Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3167,6 +3167,30 @@ public void Issue426_SO34439033_DateTimeGainsTicks()
}
}

[FactMySql]
public void SO36303462_Tinyint_Bools()
{
using (var conn = GetMySqlConnection(true, true, true))
{
try { conn.Execute("drop table SO36303462_Test"); } catch { }
conn.Execute("create table SO36303462_Test (Id int not null, IsBold tinyint not null);");
conn.Execute("insert SO36303462_Test (Id, IsBold) values (1,1);");
conn.Execute("insert SO36303462_Test (Id, IsBold) values (2,0);");
conn.Execute("insert SO36303462_Test (Id, IsBold) values (3,1);");

var rows = conn.Query<SO36303462>("select * from SO36303462_Test").ToDictionary(x => x.Id);
rows.Count.IsEqualTo(3);
rows[1].IsBold.IsTrue();
rows[2].IsBold.IsFalse();
rows[3].IsBold.IsTrue();
}
}
class SO36303462
{
public int Id { get; set; }
public bool IsBold { get; set; }
}

public class Issue426_Test
{
public long Id { get; set; }
Expand Down

0 comments on commit 92eca47

Please sign in to comment.