FileSqlServerSync/Server/LocalServer/Program.cs
zerlei 78d9e68fea refactor:将每个测试方法改为相互独立
原因是:

1.  相互独立的单元测试,有助于debug问题,
2.  不需要考虑执行顺序,额外的运行环境等,更加简单。
做的工作是:
1. 去掉了顺序执行,这有助于并发调用,减少测试时间
2. 去掉了测试方法中共享的实例
2024-10-12 22:00:25 +08:00

27 lines
601 B
C#

using LocalServer;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddSingleton<LocalSyncServerFactory>();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseWebSockets();
app.UseAuthorization();
app.MapControllers();
app.Run();