skipcheck

TM1 Testcontainers · Docs · Writing tests

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 staticWhy a test is skipped without a source.
RequiresCognosFactAttribute constructorSkips unless there's TM1 and Cognos to test against.
NoDockerMessage staticWhy a test is skipped without Docker.
Tm1SkipReason staticWhy a TM1 test is skipped, or null to run it (a wrong source runs it, to fail).

NoSourceMessage

static
const string NoSourceMessage

Why a test is skipped without a source.

RequiresCognosFactAttribute

constructor
RequiresCognosFactAttribute()

Skips unless there's TM1 and Cognos to test against.

NoDockerMessage

static
const string NoDockerMessage

Why a test is skipped without Docker.

Tm1SkipReason

static
string? Tm1SkipReason()

Why a TM1 test is skipped, or null to run it (a wrong source runs it, to fail).