RequiresCognosFactAttribute
using Skipcheck.Tm1.Testcontainers.Xunit;Runs a test class or method that needs IBM Cognos Analytics (CAM security) as well as TM1, and skips it when either isn't available.
It includes RequiresTm1FactAttribute, so tests also skip without Docker or a
Tm1Source. Declare a CognosSource parameter to get the source
CognosSource.Discover found. Cognos takes minutes to start and its test users
vary by test, so there's no shared Cognos: build a CognosContainer with the
users the test needs.
public sealed class CamSecurityTests(CognosFixture cognos) : IClassFixture<CognosFixture>
{
[RequiresCognosFact]
public async Task ReadersCanOnlyRead()
{
// No shared Cognos: each test starts its own, with the users it needs
await using var container = new CognosContainer(cognos.Source).WithUser("viewer", "viewerpw", "Readers");
await container.StartAsync();
// ...
}
}
Members
NoSourceMessage static | Why a test is skipped without a source. |
RequiresCognosFactAttribute constructor | Skips unless there's TM1 and Cognos to test against. |
NoDockerMessage static | Why a test is skipped without Docker. |
Tm1SkipReason static | Why a TM1 test is skipped, or null to run it (a wrong source runs it, to fail). |
NoSourceMessage
staticconst string NoSourceMessageWhy a test is skipped without a source.
RequiresCognosFactAttribute
constructorRequiresCognosFactAttribute()Skips unless there's TM1 and Cognos to test against.
NoDockerMessage
staticconst string NoDockerMessageWhy a test is skipped without Docker.
Tm1SkipReason
staticstring? Tm1SkipReason()Why a TM1 test is skipped, or null to run it (a wrong source runs it, to fail).