7b0b9c7365
Solution + 23 src projects + 26 test projects renamed; folders, csproj, namespaces, and ScadaLinkDbContext/ScadaBridgeDbContext class updated. ActorSystem "scadalink" → "scadabridge", Akka seed-node URLs migrated. SQL roles/logins, LDAP domains, CLI command name, and CLI config dir (~/.scadalink → ~/.scadabridge) also renamed. Build green; 5 Host.Tests fail awaiting SQL login rename in next commit. Pre-existing StaleTagMonitor timing flakes unchanged. Rename script committed at tools/rename-to-scadabridge.sh.
67 lines
2.2 KiB
C#
67 lines
2.2 KiB
C#
namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests;
|
|
|
|
/// <summary>
|
|
/// Basic compilation and type-existence tests for Phase 4-6 UI pages.
|
|
/// Full rendering tests would require bUnit or WebApplicationFactory (Phase 8).
|
|
/// These verify pages compile and key types are accessible.
|
|
/// </summary>
|
|
public class UnitTest1
|
|
{
|
|
[Fact]
|
|
public void CentralUI_Assembly_IsLoadable()
|
|
{
|
|
var assembly = typeof(ServiceCollectionExtensions).Assembly;
|
|
Assert.NotNull(assembly);
|
|
Assert.Equal("ZB.MOM.WW.ScadaBridge.CentralUI", assembly.GetName().Name);
|
|
}
|
|
|
|
[Fact]
|
|
public void Pages_AllExist_InAssembly()
|
|
{
|
|
var assembly = typeof(ServiceCollectionExtensions).Assembly;
|
|
var types = assembly.GetTypes();
|
|
|
|
// Verify all Phase 4-6 page types exist by checking they compiled
|
|
var pageRoutes = new[]
|
|
{
|
|
"Admin_Sites",
|
|
"Admin_DataConnections",
|
|
"Admin_Areas",
|
|
"Admin_ApiKeys",
|
|
"Admin_LdapMappings",
|
|
"Monitoring_Health",
|
|
"Monitoring_EventLogs",
|
|
"Monitoring_ParkedMessages",
|
|
"Monitoring_AuditLog",
|
|
"Deployment_Instances",
|
|
"Deployment_Deployments",
|
|
"Deployment_DebugView",
|
|
"Design_Templates",
|
|
"Design_SharedScripts",
|
|
"Design_ExternalSystems",
|
|
};
|
|
|
|
// Pages compile into types named like Components_Pages_Admin_Sites
|
|
// We can't check exact names since Razor generates them, but we can verify the assembly has many types
|
|
Assert.True(types.Length > 15, $"Expected many types in CentralUI assembly, got {types.Length}");
|
|
}
|
|
|
|
[Fact]
|
|
public void SharedComponents_Exist_InAssembly()
|
|
{
|
|
var assembly = typeof(ServiceCollectionExtensions).Assembly;
|
|
var typeNames = assembly.GetTypes().Select(t => t.Name).ToHashSet();
|
|
|
|
// Shared components should compile into types
|
|
Assert.True(assembly.GetTypes().Length > 0);
|
|
}
|
|
|
|
[Fact]
|
|
public void ServiceCollectionExtensions_AddCentralUI_IsCallable()
|
|
{
|
|
// Verify the extension method exists and is callable
|
|
var method = typeof(ServiceCollectionExtensions).GetMethod("AddCentralUI");
|
|
Assert.NotNull(method);
|
|
}
|
|
}
|