Agent skill

Orchardcore Unit Test

by OrchardCMS in OrchardCMS/OrchardCore

Writes and runs OrchardCore tests — xUnit unit tests, SiteContext-based integration tests, Moq mocking, and Playwright functional tests.

BSD-3-ClauseAuto-check passedTesting & QA

Install Orchardcore Unit Test

skills CLI
$ npx skills add OrchardCMS/OrchardCore --skill orchardcore-unit-test -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install OrchardCMS/OrchardCore orchardcore-unit-test --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/OrchardCMS/OrchardCore.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/orchardcore-unit-test .claude/skills/orchardcore-unit-test && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
orchardcore-unit-test
GitHub stars
8.2k
Token cost
~1.6k tokens
SKILL.md length
408 words
Files
2 (incl. references)
Skills in repo
16
Repo updated
First seen
Licence
BSD-3-Clause

At a glance

Writes and runs OrchardCore tests — xUnit unit tests, SiteContext-based integration tests, Moq mocking, and Playwright functional tests.

  • Works in 2 steps: Add a test class → Mock dependencies with Moq
  • The user needs to add a test
  • SKILL.md covers Decide the test type, Workflow A: unit test, Workflow B: integration test… and Workflow C: functional test…, plus 4 more sections
  • Calls dotnet and yarn

What it does

Orchardcore Unit Test is an agent skill from OrchardCMS/OrchardCore. Writes and runs OrchardCore tests — xUnit unit tests, SiteContext-based integration tests, Moq mocking, and Playwright functional tests. Use when the user needs to add a test, set up a test harness/tenant for tests, mock OrchardCore services, or run the test suite.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/testing.md`).

It sits in Testing & QA, covering Unit testing and Integration testing. It works with Playwright. The repository describes itself as: Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework. The licence is BSD-3-Clause.

When your agent uses it

  • The user needs to add a test
  • Set up a test harness/tenant for tests
  • Mock OrchardCore services
  • Run the test suite

Example prompts

  • “Use the orchardcore-unit-test skill to write and runs OrchardCore tests — xUnit unit tests, SiteContext-based integration tests, Moq mocking, and…”
  • “/orchardcore-unit-test”

Workflow steps

2 steps, taken from the step headings in SKILL.md.

  1. Add a test class
  2. Mock dependencies with Moq

What it can do on your machine

Read from SKILL.md and the folder at commit d6bb7b4. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • dotnet
    • yarn

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use yarn, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Orchardcore Unit Test loads about 1.6k tokens when it runs, and up to ~2.8k if it reads all its reference files. Until then it costs about 72 tokens; SKILL.md has 408 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~72
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from OrchardCMS/OrchardCore at commit d6bb7b4, republished under its BSD-3-Clause licence (© OrchardCMS). 408 words, ~1,580 tokens.

Download SKILL.mdSave it as .claude/skills/orchardcore-unit-test/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
orchardcore-unit-test
description
Writes and runs OrchardCore tests — xUnit unit tests, SiteContext-based integration tests, Moq mocking, and Playwright functional tests. Use when the user needs to add a test, set up a test harness/tenant for tests, mock OrchardCore services, or run the test suite.

OrchardCore Unit & Integration Testing

This skill guides you through writing and running OrchardCore tests following project conventions.

OrchardCore uses xUnit v3 (Microsoft Testing Platform — test projects are Exe). Tests live under test/:

ProjectKind
OrchardCore.Testsunit + in-process integration (main)
OrchardCore.Abstractions.Testspure unit tests for core abstractions
OrchardCore.Tests.Integrationexternal-service integration (S3, etc.)
OrchardCore.Tests.FunctionalPlaywright browser automation
OrchardCore.BenchmarksBenchmarkDotNet (not xUnit)

Decide the test type

Testing…TypeHarness
Pure logic, a single classunitplain xUnit + Moq
A driver/service needing DIunitbuild a small ServiceCollection
Content APIs, recipes, tenant behaviorintegrationSiteContext
Admin/front-end through a browserfunctionalOrchardTestFixture + Playwright

Workflow A: unit test

Step 1: Add a test class

Naming: {Subject}Tests; methods {Action}_{Condition}_{ExpectedResult}, for example Write_WithinLimit_Succeeds.

csharp
namespace OrchardCore.Json.Nodes.Test;

public class Base64Tests
{
    [Theory]
    [InlineData("YTw+OmE/", "a<>:a?")]
    [InlineData("SGVsbA==", "Hell")]
    public void DecodeToString_ValidBase64_ReturnsDecodedString(string source, string expected)
    {
        Assert.Equal(expected, Base64.FromUTF8Base64String(source));
    }
}

Use [Fact] for single cases, [Theory] + [InlineData]/[MemberData] for parameterized. Assertions are xUnit Assert.* (no Shouldly in this repo).

Step 2: Mock dependencies with Moq
csharp
using Moq;

// Quick stub:
var clock = Mock.Of<IClock>(c => c.UtcNow == DateTime.UtcNow);

// With setup/verify:
var shellHost = new Mock<IShellHost>();
shellHost.Setup(h => h.GetScopeAsync(It.IsAny<string>())).ReturnsAsync(scope);
// ...
shellHost.Verify(h => h.GetScopeAsync("Default"), Times.Once);

Build a service provider when the unit needs DI:

csharp
var httpContext = new DefaultHttpContext
{
    RequestServices = new ServiceCollection()
        .AddSingleton(myService.Object)
        .BuildServiceProvider(),
};

Workflow B: integration test with SiteContext

SiteContext spins up a real tenant (SQLite by default) from a recipe and gives you an HttpClient + tenant scope.

csharp
public class BlogPostApiControllerTests
{
    [Fact]
    public async Task CreateDraft_ExistingContentItem_CreatesDraft()
    {
        using var context = new SiteContext();
        await context.InitializeAsync();

        var response = await context.Client.PostAsJsonAsync("api/content?draft=true", contentItem);
        var draft = await response.Content.ReadAsAsync<ContentItem>();

        Assert.True(draft.Latest);
        Assert.False(draft.Published);
    }
}

Resolve tenant services inside a scope:

csharp
await context.UsingTenantScopeAsync(async scope =>
{
    var session = scope.ServiceProvider.GetRequiredService<ISession>();
    var posts = await session.Query<ContentItem, ContentItemIndex>(x => x.ContentType == "BlogPost").ListAsync();
    Assert.Equal(2, posts.Count());
});

Customize the recipe by subclassing or WithRecipe:

csharp
public class AgencyContext : SiteContext
{
    public AgencyContext() => this.WithRecipe("Agency");
}

Defaults: RecipeName = "Blog", DatabaseProvider = "Sqlite", a random tenant name + table prefix per test.

Workflow C: functional test (Playwright)

OrchardTestFixture starts a CMS server and a headless Chromium browser.

csharp
var page = await fixture.CreatePageAsync();
await page.GotoAsync("/");
await Expect(page.Locator("h1")).ToBeVisibleAsync();

Set PLAYWRIGHT_TRACING to capture screenshots/snapshots/sources into traces/.

Running tests

bash
# All tests in a project (from repo root)
dotnet test test/OrchardCore.Tests/OrchardCore.Tests.csproj

# Filter by name (xUnit / MTP)
dotnet test test/OrchardCore.Tests/OrchardCore.Tests.csproj --filter "FullyQualifiedName~BlogPost"

CI requires all tests green. If you change CSS/JS, run yarn build first (asset tests).

Quick Reference

Show full SKILL.md (168 more words)Show less
xUnit attributes
AttributeUse
[Fact]one test case
[Theory] + [InlineData]inline parameter sets
[Theory] + [MemberData(nameof(X))]computed parameter sets
Common assertions

Assert.Equal, Assert.True/False, Assert.Null/NotNull, Assert.Contains, Assert.Throws<T>, await Assert.ThrowsAsync<T>(...).

SiteContext members
MemberPurpose
InitializeAsync()create + set up the tenant
ClientHttpClient bound to the tenant
UsingTenantScopeAsync(fn)run code in the tenant's DI scope
GraphQLClientGraphQL API client
RecipeName / DatabaseProvideroverride before InitializeAsync
Moq cheatsheet
NeedCode
Stub a propertyMock.Of<I>(x => x.P == v)
Setup a methodm.Setup(x => x.F(It.IsAny<T>())).ReturnsAsync(r)
Verify a callm.Verify(x => x.F(arg), Times.Once)
Pass the objectm.Object

Gotchas

  • Test projects are Exe (MTP) — keep that OutputType when adding one; don't switch to library.
  • SiteContext is IDisposable — always using var context = ....
  • Resolve tenant services only inside UsingTenantScopeAsync; the outer scope isn't the tenant.
  • Integration tests use SQLite + a fresh per-test table prefix; tests must not assume shared state.
  • Guard refactors with tests — the contributing guide requires new tests for refactoring.

References

  • references/testing.md — SiteContext internals, fixtures, Playwright, project layout
  • src/docs/contributing/contributing-code.md (repo) — test expectations
  • test/OrchardCore.Tests/ (repo) — real examples
  • AGENTS.md (repo root) — build commands

© OrchardCMS, BSD-3-Clause. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in .agents/skills/orchardcore-unit-test of OrchardCMS/OrchardCore.

  • SKILL.md
  • references/testing.md

Open the folder on GitHubat commit d6bb7b4

Compare with similar skills

Orchardcore Unit Test next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Orchardcore Unit Test compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Orchardcore Unit Test this skillOrchardCMS/OrchardCore8.2k—~1.6kAutomated safety check: PassBSD-3-Clause
Aspire Integration TestingDevBetterCom/DevBetterWeb1572 repos~2.3kAutomated safety check: PassNone
JS-in-HTML Testingliaohch3/claude-tap3.3k—~924Automated safety check: PassMIT
Dotnet Testingnovotnyllc/dotnet-artisan233—~972Automated safety check: PassMIT
Dotnet Testingmacalbert/envilder138—~1.6kAutomated safety check: PassMIT
Supercheck Testing QAsupercheck-io/supercheck215—~942Automated safety check: PassAGPL-3.0

Similar skills

  • Aspire Integration Testing

    DevBetterCom/DevBetterWeb

    Write integration tests using .NET Aspire's testing facilities with xUnit.

    157 GitHub starsUsed in 2 repos~2.3k tokens
    Testing & QAAuto-check passed
  • JS-in-HTML Testing

    liaohch3/claude-tap

    Tests JavaScript embedded in an HTML file in two layers: pytest checks of the logic ported to Python, and Playwright runs in a real browser for the DOM.

    3.3k GitHub stars~924 tokensUpdated 16 days ago
    Testing & QAAuto-check passed
  • Dotnet Testing

    novotnyllc/dotnet-artisan

    Defines .NET test strategy and implementation patterns across xUnit v3 (Facts, Theories, fixtures, IAsyncLifetime), integration testing (WebApplicationFactory, Testcontainers), Aspire testing…

    233 GitHub stars~972 tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Dotnet Testing

    macalbert/envilder

    Mandatory testing conventions for .NET (xUnit, AwesomeAssertions).

    138 GitHub stars~1.6k tokensUpdated 3 days ago
    Testing & QAAuto-check passed
  • Supercheck Testing QA

    supercheck-io/supercheck

    Test or validate Supercheck changes using package checks, Jest, Playwright UI/API E2E, recorder browser tests, contract tests, AI SRE acceptance, release evidence, and commit/merge readiness gates.

    215 GitHub stars~942 tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Testing Guide

    mobazha/mobazha-unified

    Guide for writing unit tests (Vitest), integration tests, and E2E tests (Playwright) following Mobazha project conventions.

    165 GitHub stars~1.7k tokensUpdated 5 days ago
    Testing & QAAuto-check passed

More from OrchardCMS/OrchardCore

All 16 skills in this repo
  • Orchardcore Admin Edit Views

    OrchardCMS/OrchardCore

    Creates and updates OrchardCore admin edit views using the ocat- CSS class conventions.

    8.2k GitHub stars~3.7k tokensUpdated yesterday
    Auto-check passed
  • Orchardcore Asset Manager

    OrchardCMS/OrchardCore

    Builds, watches, and manages frontend assets in OrchardCore.

    8.2k GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed
  • Orchardcore Data Migration

    OrchardCMS/OrchardCore

    Creates and updates OrchardCore data migrations (DataMigration classes with CreateAsync/UpdateFromX).

    8.2k GitHub stars~1.7k tokensUpdated yesterday
    Auto-check passed
  • Orchardcore Display Management

    OrchardCMS/OrchardCore

    Controls how OrchardCore renders content — placement.json rules, display drivers, shapes, zones, alternates, and editor groupings (tabs/cards/columns).

    8.2k GitHub stars~1.8k tokensUpdated yesterday
    Auto-check passed
  • Orchardcore Docs Writer

    OrchardCMS/OrchardCore

    Authors OrchardCore documentation — MkDocs Material pages, module README docs, nav entries, admonitions, tabbed content, and redirects.

    8.2k GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Orchardcore Localization

    OrchardCMS/OrchardCore

    Localizes OrchardCore apps — UI strings (IStringLocalizer/IViewLocalizer S, T, H), PO files and pluralization, content translation (LocalizationPart, culture picker), and supported-culture…

    8.2k GitHub stars~1.7k tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about Orchardcore Unit Test

What does Orchardcore Unit Test do?

Writes and runs OrchardCore tests — xUnit unit tests, SiteContext-based integration tests, Moq mocking, and Playwright functional tests. Orchardcore Unit Test is an agent skill from OrchardCMS/OrchardCore. Writes and runs OrchardCore tests — xUnit unit tests, SiteContext-based integration tests, Moq mocking, and Playwright functional tests.

When should I use Orchardcore Unit Test?

Orchardcore Unit Test fits situations like: the user needs to add a test; set up a test harness/tenant for tests; mock OrchardCore services; run the test suite.

How do I install Orchardcore Unit Test in Claude Code?

Run `npx skills add OrchardCMS/OrchardCore --skill orchardcore-unit-test -a claude-code`. Or copy the skill folder (.agents/skills/orchardcore-unit-test in OrchardCMS/OrchardCore) into .claude/skills/orchardcore-unit-test in your project. Claude Code loads it when a task matches its description.

How do I install Orchardcore Unit Test in Codex?

Run `npx skills add OrchardCMS/OrchardCore --skill orchardcore-unit-test -a codex`. Or copy the skill folder (.agents/skills/orchardcore-unit-test in OrchardCMS/OrchardCore) into .agents/skills/orchardcore-unit-test in your project. Codex loads it when a task matches its description.

Can I use Orchardcore Unit Test in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add OrchardCMS/OrchardCore --skill orchardcore-unit-test -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/orchardcore-unit-test, .gemini/skills/orchardcore-unit-test, .github/skills/orchardcore-unit-test and .opencode/skills/orchardcore-unit-test in your project.

What does Orchardcore Unit Test need to run?

Going by SKILL.md and its folder, Orchardcore Unit Test needs the command-line tools its instructions call (dotnet and yarn).

Does Orchardcore Unit Test access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Orchardcore Unit Test safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Orchardcore Unit Test use?

Orchardcore Unit Test is published under the BSD-3-Clause licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Orchardcore Unit Test use?

About 1.6k tokens (SKILL.md is roughly 6.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.2k tokens, read only when the agent opens those files.

What are the alternatives to Orchardcore Unit Test?

Skills that share tags, products or a category with Orchardcore Unit Test: Aspire Integration Testing (DevBetterCom/DevBetterWeb, 157 stars), JS-in-HTML Testing (liaohch3/claude-tap, 3.3k stars), Dotnet Testing (novotnyllc/dotnet-artisan, 233 stars) and Dotnet Testing (macalbert/envilder, 138 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Orchardcore Unit Test?

OrchardCMS (a GitHub organization) maintains it in OrchardCMS/OrchardCore, which has 8,195 GitHub stars. The repository holds 16 skills in this directory. The repository was last updated on October 8, 2026.

Source: OrchardCMS/OrchardCore on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.