mirror of
https://github.com/dotnetcore/Util.git
synced 2026-10-19 05:31:23 +08:00
28 lines
984 B
C#
28 lines
984 B
C#
using System;
|
|
using System.Threading.Tasks;
|
|
using Util.Data.Sql;
|
|
using Util.Tests.Configs;
|
|
|
|
namespace Util.Data.Dapper.Tests.SqlExecutor {
|
|
/// <summary>
|
|
/// Oracle Sql执行器测试 - 执行Sql测试
|
|
/// </summary>
|
|
public partial class OracleExecutorTest {
|
|
/// <summary>
|
|
/// 测试执行Sql增删改操作
|
|
/// </summary>
|
|
[Fact]
|
|
public async Task TestExecuteAsync() {
|
|
var id = Guid.NewGuid();
|
|
await _sqlExecutor
|
|
.AppendLine( "Insert Into \"Product\"(\"ProductId\",\"Code\") " )
|
|
.Append( "Values(:ProductId,:Code)" )
|
|
.AddParam( ":ProductId", id )
|
|
.AddParam( "Code", TestConfig.Value )
|
|
.ExecuteAsync();
|
|
var result = await _sqlExecutor.Select( "Code" ).From( "Product" ).Where( "ProductId", id ).ToStringAsync();
|
|
Assert.Equal( TestConfig.Value, result );
|
|
}
|
|
}
|
|
}
|