Local Aspire has no published client folder; the middleware warned on every boot. Co-authored-by: Cursor <cursoragent@cursor.com>
29 lines
812 B
C#
29 lines
812 B
C#
namespace HSchool.Server.Tests;
|
|
|
|
public class ClientStaticFilesTests
|
|
{
|
|
[Fact]
|
|
public void CanServe_IsFalseWhenTheDirectoryIsMissing()
|
|
{
|
|
var missing = Path.Combine(Path.GetTempPath(), "h-school-no-wwwroot-" + Guid.NewGuid().ToString("N"));
|
|
|
|
Assert.False(ClientStaticFiles.CanServe(missing));
|
|
Assert.False(ClientStaticFiles.CanServe(null));
|
|
Assert.False(ClientStaticFiles.CanServe(""));
|
|
}
|
|
|
|
[Fact]
|
|
public void CanServe_IsTrueWhenTheDirectoryExists()
|
|
{
|
|
var directory = Directory.CreateTempSubdirectory("h-school-wwwroot-");
|
|
try
|
|
{
|
|
Assert.True(ClientStaticFiles.CanServe(directory.FullName));
|
|
}
|
|
finally
|
|
{
|
|
directory.Delete(recursive: true);
|
|
}
|
|
}
|
|
}
|