2025迁移版本,多项规则修改
This commit is contained in:
33
MesETL.Test/Services/SeqServiceTests.cs
Normal file
33
MesETL.Test/Services/SeqServiceTests.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Reflection;
|
||||
using Azusa.Shared.Extensions;
|
||||
using MesETL.App.Options;
|
||||
using MesETL.App.Services.Seq;
|
||||
using Microsoft.Extensions.Options;
|
||||
using TestProject1.XUnit;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace TestProject1.Services;
|
||||
|
||||
public class SeqServiceTests : TestBase
|
||||
{
|
||||
public SeqServiceTests(ITestOutputHelper output) : base(output)
|
||||
{
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Test_Sequence_Sql_Generation()
|
||||
{
|
||||
var sut = new SeqService(new OptionsWrapper<DatabaseOutputOptions>(new DatabaseOutputOptions()
|
||||
{
|
||||
ConnectionString = "Server=127.0.0.1;Port=3306;UserId=root;Password=123456;"
|
||||
}));
|
||||
|
||||
foreach (var i in 10)
|
||||
{
|
||||
Write("Seq: " + sut.AddCachedSeq(SeqConfig.OrderWaveGroupID));
|
||||
}
|
||||
|
||||
var sql = typeof(SeqService).GetMethod("GenerateCachedSeqSql", BindingFlags.Instance | BindingFlags.NonPublic)!.Invoke(sut, []);
|
||||
Write(sql ?? "null");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user