Files
mxaccessgw/src/ZB.MOM.WW.MxGateway.IntegrationTests/Galaxy/GalaxyRepositoryLiveTests.cs
T
Joseph Doherty a1156960b9 docs: add missing XML doc comments across gateway, worker, and .NET client
Resolves 1113 documentation-completeness gaps flagged by CommentChecker
(MissingReturns, MissingInheritDoc, InheritDocMisused, MissingDoc,
MissingParam, RedundantInheritDoc) so the API surface is fully documented
and the analyzer scan is clean. Doc comments only; no code changes.
2026-06-03 12:33:53 -04:00

75 lines
2.8 KiB
C#

using ZB.MOM.WW.MxGateway.Server.Galaxy;
namespace ZB.MOM.WW.MxGateway.IntegrationTests.Galaxy;
[Collection(LiveResourcesCollection.Name)]
[Trait("Category", "LiveGalaxy")]
public sealed class GalaxyRepositoryLiveTests
{
/// <summary>Verifies that the Galaxy Repository can establish a live connection to the ZB database.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[LiveGalaxyRepositoryFact]
public async Task TestConnection_AgainstZb_Succeeds()
{
GalaxyRepository repository = CreateRepository();
bool ok = await repository.TestConnectionAsync(CancellationToken.None);
Assert.True(ok, "TestConnectionAsync should return true against the ZB database.");
}
/// <summary>Verifies that the last deploy time can be retrieved from the ZB database.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[LiveGalaxyRepositoryFact]
public async Task GetLastDeployTime_AgainstZb_ReturnsTimestamp()
{
GalaxyRepository repository = CreateRepository();
DateTime? lastDeploy = await repository.GetLastDeployTimeAsync(CancellationToken.None);
Assert.NotNull(lastDeploy);
}
/// <summary>Verifies that the hierarchy can be retrieved from the ZB database.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[LiveGalaxyRepositoryFact]
public async Task GetHierarchy_AgainstZb_ReturnsObjects()
{
GalaxyRepository repository = CreateRepository();
List<GalaxyHierarchyRow> rows = await repository.GetHierarchyAsync(CancellationToken.None);
Assert.NotEmpty(rows);
Assert.All(rows, row =>
{
Assert.True(row.GobjectId > 0);
Assert.False(string.IsNullOrEmpty(row.TagName));
Assert.False(string.IsNullOrEmpty(row.BrowseName));
});
}
/// <summary>Verifies that object attributes can be retrieved from the ZB database.</summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[LiveGalaxyRepositoryFact]
public async Task GetAttributes_AgainstZb_ReturnsAtLeastOneAttribute()
{
GalaxyRepository repository = CreateRepository();
List<GalaxyAttributeRow> rows = await repository.GetAttributesAsync(CancellationToken.None);
Assert.NotEmpty(rows);
Assert.All(rows, row =>
{
Assert.True(row.GobjectId > 0);
Assert.False(string.IsNullOrEmpty(row.AttributeName));
Assert.False(string.IsNullOrEmpty(row.FullTagReference));
});
}
private static GalaxyRepository CreateRepository() => new(new GalaxyRepositoryOptions
{
ConnectionString = LiveGalaxyRepositoryFactAttribute.ConnectionString,
CommandTimeoutSeconds = 30,
});
}