update Ado Tests

This commit is contained in:
28810
2020-04-21 14:38:14 +08:00
parent c45d8d3c0b
commit d29a6f596b
2 changed files with 29 additions and 1 deletions

View File

@ -31,8 +31,20 @@ namespace FreeSql.Tests.MySqlConnector
[Fact]
public void ExecuteNonQuery()
{
var item = new TestExecute01 { title = "title01" };
g.mysql.Insert(item).ExecuteAffrows();
var affrows = g.mysql.Ado.ExecuteNonQuery("update TestExecute01 set title = '<27><><EFBFBD><EFBFBD>' where id=@id", new { id = item.id });
Assert.Equal(1, affrows);
var item2 = g.mysql.Select<TestExecute01>(item).First();
Assert.NotNull(item2);
Assert.Equal("<22><><EFBFBD><EFBFBD>", item2.title);
}
class TestExecute01
{
public Guid id { get; set; }
public string title { get; set; }
}
[Fact]
public void ExecuteScalar()
{