一键导入
servicestack-testing
Tests services using ServiceStack’s testing utilities and in-memory hosts.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Tests services using ServiceStack’s testing utilities and in-memory hosts.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | servicestack-testing |
| description | Tests services using ServiceStack’s testing utilities and in-memory hosts. |
ServiceStack provides excellent support for both unit and integration testing.
Service class.var service = new MyService { Db = dbFactory.Open() };
var response = service.Any(new MyRequest { ... });
Assert.That(response.Result, Is.EqualTo("Expected"));
BasicAppHost or InMemoryAppHost for light integration tests.AppHost (self-hosted or TestServer) for end-to-end tests with typed clients.public class MyIntegrationTest : ServiceStackTestBase
{
public MyIntegrationTest()
{
ConfigureAppHost(new AppHost());
}
[Test]
public void Can_call_service()
{
var client = CreateClient();
var response = client.Get(new MyRequest { ... });
// ... assertions
}
}
ServiceStack is designed for easy DI, so you can easily swap real implementations with mocks (e.g., Moq, NSubstitute) in your AppHost configuration during tests.
AppHost configuration for related integration tests.Designs stable, discoverable APIs using routes, metadata, and versioning conventions.
Implements authentication using ServiceStack Auth Providers and session handling.
Applies role-, permission-, and ownership-based authorization using ServiceStack idioms.
Implements AutoQuery services, custom filters, and permission-aware querying.
Designs request/response DTOs using DTO-first, message-based ServiceStack conventions.
Controls OpenAPI / metadata exposure without compromising ServiceStack-first design.