mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-08-18 15:33:33 +08:00
changed.项目结构优化
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using Xunit;
|
||||
|
||||
namespace LanMountainDesktop.Tests;
|
||||
|
||||
public sealed class LauncherStartupTimeoutPolicyTests
|
||||
{
|
||||
[Fact]
|
||||
public void LauncherStartupTimeouts_MatchSlowStartupContract()
|
||||
{
|
||||
var source = ReadRepositoryFile("desktop", "LanMountainDesktop.Launcher", "Startup", "StartupTimeoutPolicy.cs");
|
||||
|
||||
Assert.Contains("SoftTimeout = TimeSpan.FromSeconds(30)", source);
|
||||
Assert.Contains("HardTimeout = TimeSpan.FromSeconds(120)", source);
|
||||
}
|
||||
|
||||
private static string ReadRepositoryFile(params string[] pathParts)
|
||||
{
|
||||
var directory = new DirectoryInfo(AppContext.BaseDirectory);
|
||||
while (directory is not null && !File.Exists(Path.Combine(directory.FullName, "LanMountainDesktop.slnx")))
|
||||
{
|
||||
directory = directory.Parent;
|
||||
}
|
||||
|
||||
if (directory is null)
|
||||
{
|
||||
throw new DirectoryNotFoundException("Unable to locate repository root.");
|
||||
}
|
||||
|
||||
return File.ReadAllText(Path.Combine([directory.FullName, .. pathParts]));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user