Agenix.Screenplay
0.1.0-alpha0120
See the version list below for details.
dotnet add package Agenix.Screenplay --version 0.1.0-alpha0120
NuGet\Install-Package Agenix.Screenplay -Version 0.1.0-alpha0120
<PackageReference Include="Agenix.Screenplay" Version="0.1.0-alpha0120" />
<PackageVersion Include="Agenix.Screenplay" Version="0.1.0-alpha0120" />
<PackageReference Include="Agenix.Screenplay" />
paket add Agenix.Screenplay --version 0.1.0-alpha0120
#r "nuget: Agenix.Screenplay, 0.1.0-alpha0120"
#addin nuget:?package=Agenix.Screenplay&version=0.1.0-alpha0120&prerelease
#tool nuget:?package=Agenix.Screenplay&version=0.1.0-alpha0120&prerelease
<div align="center">
Agenix Integration Testing ![Agenix Icon]()
<p><strong>Test the Pieces.Verify the Whole.</strong></p> <p><em>Intelligent integration testing framework for modern applications</em></p>
</div>
Agenix is a comprehensive test automation framework built with C# .NET 8.0 that enables the creation of fully automated end-to-end use case tests for enterprise SOA applications. Designed with modern testing patterns and practices, Agenix provides a robust foundation for testing complex distributed systems, APIs, databases, and user workflows.
Key Features
- 🎭 Screenplay Pattern: Actor-based testing with fluent, readable test scenarios using Tasks, Questions, and Abilities
- 🌐 Multi-Protocol Support: Built-in support for HTTP/REST APIs, GraphQL, SQL databases, and web services
- 🔧 Framework Integration: Seamless integration with NUnit and Reqnroll (SpecFlow successor) for BDD testing
- ✅ Rich Validation: Comprehensive validation capabilities for JSON, text, binary data, and custom formats
- 🏗️ Modular Architecture: Clean separation of concerns with extensible, plugin-based design
- 📊 Advanced Reporting: Detailed test execution reports with contextual information
- 🔄 Enterprise Ready: Built for complex SOA environments with session management and context handling
What Makes Agenix Different
1. Intelligent Marshalling & Serialization Architecture
- Multi-Protocol Marshalling: Agenix provides sophisticated object marshalling capabilities with automatic type detection and resolution
- Pluggable Serializers: Support for multiple serialization formats (JSON, XML, Binary) with automatic serializer selection
- Dynamic Content Resolution: Built-in variable substitution and dynamic content generation during test execution
2. Enterprise-Grade Resource Management
- Resource Path Type Resolution: Unique that can dynamically resolve types and properties from assembly resources
ResourcePathTypeResolver
- Cached Type Resolution: Intelligent caching system for type lookups to improve performance in large test suites
- Flexible Resource Loading: Support for loading configuration and types from embedded resources with fallback mechanisms
3. Comprehensive Validation Ecosystem
- Multi-Format Validation: Dedicated validation modules for JSON, XML, Text, and Binary data
- NHamcrest Integration: Fluent assertion syntax with composable matchers
- Context-Aware Validation: Validation contexts that understand the testing environment and can adapt accordingly
4. Advanced Message Building Pattern
- Polymorphic Payload Builders: Support for different payload building strategies (marshalling, serialization, static content)
- Header Data Builders: Specialized builders for message headers with marshalling support
- Type-Safe Message Construction: Strong typing throughout the message building process
5. Modular Protocol Support
- Protocol Abstraction: Clean separation between protocol implementations (HTTP, GraphQL, SQL, etc.)
- Endpoint Configuration: Flexible endpoint configuration system that supports multiple communication protocols
- Producer/Consumer Pattern: Consistent messaging patterns across different protocols
6. Intelligent Reference Resolution
- Dependency Injection: Built-in reference resolver that acts as a lightweight DI container
- Auto-Detection: Automatic detection of available services and marshallers
- Named Resolution: Support for named instances and type-specific resolution
7. Enterprise Integration Features
- Session Management: Built-in session handling for complex enterprise workflows
- Context Propagation: Test context that maintains state across test steps
- Transaction Support: Database transaction management for data integrity
8. BDD Integration Excellence
- Reqnroll Plugin: Deep integration with Reqnroll (SpecFlow successor) for modern BDD testing
- Gherkin Support: Native support for Gherkin syntax with step definition automation
- Business-Readable Tests: Framework designed to bridge technical implementation and business requirements
9. Test Execution Engine
- Action-Based Architecture: Test actions as first-class citizens with lifecycle management
- Sequence Management: Before/after test sequences with dependency resolution
- Listener Pattern: Extensible test action listeners for custom behavior
10. Developer Experience Focus
- Fluent APIs: Consistent fluent interface design across all modules
- Type Safety: Strong typing throughout the framework to catch errors at compile time
- IntelliSense Support: Rich metadata and documentation for IDE integration
The framework's architecture demonstrates a sophisticated approach to test automation that goes beyond simple API testing, providing a comprehensive platform for complex enterprise testing scenarios with emphasis on maintainability, readability, and extensibility.
️ Framework Origins
This framework is based on the Citrus Framework, originally developed for Java-based integration testing. Key portions of this .NET implementation were derived from and inspired by the Citrus Framework codebase.
- Original Citrus Framework: Copyright (C) 2006-2024 the original author or authors
- License: Both projects are licensed under Apache License 2.0
- Agenix Implementation: Copyright (C) 2025 Agenix
We extend our gratitude to the Citrus Framework maintainers and contributors for their excellent work that served as the foundation for this .NET adaptation.
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
This project includes software derived from the Citrus Framework - see the NOTICE file for additional attribution details.
Related Projects
- Citrus Framework (Java) - The original framework that inspired this implementation
Table of Contents
Overview
Agenix.ATF is a comprehensive test framework built on .NET 8.0, designed to provide robust testing capabilities with modern testing patterns and practices.
Technologies Used
- .NET 8.0 - Target framework
- C# 12.0 - Programming language
- NUnit 3.x-4.x - Testing framework
- NSubstitute - Mocking library
Prerequisites
Before you begin, ensure you have the following installed:
- .NET 8.0 SDK or later
- JetBrains Rider (recommended) or Visual Studio 2022+
- Git for version control
Getting Started
1. Clone the Repository
git clone <repository-url>
cd Agenix.ATF
Module Overview
🏗️ Core Framework Modules
Module | Description | Key Features |
---|---|---|
Agenix.Api | Core interfaces and contracts for the testing framework | • API definitions<br>• Interface contracts<br>• Common types<br>• Exception definitions |
Agenix.Core | Main implementation of the framework logic | • Test execution engine<br>• Context management<br>• Action builders<br>• Session handling |
🌐 Protocol & Communication Modules
Module | Description | Key Features |
---|---|---|
Agenix.Http | HTTP client testing capabilities and utilities | • HTTP request/response handling<br>• REST API testing<br>• HTTP validation |
Agenix.GraphQL | GraphQL client testing capabilities and utilities | • GraphQL query/mutation handling<br>• GraphQL server integration<br>• Response validation |
Agenix.Sql | Database testing and SQL execution utilities | • Database connectivity<br>• SQL query execution<br>• Data validation<br>• Transaction management |
🎭 Testing Pattern Implementations
Module | Description | Key Features |
---|---|---|
Agenix.Screenplay | Screenplay pattern implementation for readable tests | • Actor-based testing<br>• Task and Question abstractions<br>• Ability pattern<br>• Fluent test scenarios |
🔌 Framework Integration Modules
Module | Description | Key Features |
---|---|---|
Agenix.NUnit.Runtime | NUnit test framework integration | • NUnit test execution<br>• Custom attributes<br>• Test lifecycle management<br>• Result reporting |
Agenix.ReqnrollPlugin | Reqnroll (SpecFlow successor) BDD integration | • Gherkin syntax support<br>• Step definitions<br>• Feature file parsing<br>• BDD test execution |
✅ Validation & Assertion Modules
Module | Description | Key Features |
---|---|---|
Agenix.Validation.Binary | Binary file and data validation | • Binary file comparison<br>• Byte array validation<br>• File format verification<br>• Checksum validation |
Agenix.Validation.Json | JSON schema and content validation | • JSON schema validation<br>• Content comparison<br>• Path-based assertions<br>• Structure verification |
Agenix.Validation.NHamcrest | Hamcrest-style matcher library | • Fluent assertion syntax<br>• Custom matchers<br>• Readable error messages<br>• Composable assertions |
Agenix.Validation.Text | Text content and format validation | • String comparison<br>• Pattern matching<br>• Format validation<br>• Text transformation |
Agenix.Validation.Xml | XML schema and content validation | • XML schema validation<br>• Content comparison<br>• XPath-based assertions<br>• Structure verification<br>• Namespace handling |
🧪 Unit Test Project Modules
Test Project | Purpose | Test Types |
---|---|---|
Agenix.Core.NUnitTestProject | Core framework functionality testing | • Unit tests<br>• Integration tests<br>• Framework behavior validation |
Agenix.Screenplay.Tests | Screenplay pattern feature validation | • Actor behavior tests<br>• Task execution tests<br>• Question answering tests |
Agenix.ReqnrollPlugin.Tests | BDD plugin functionality testing | • Step definition tests<br>• Feature parsing tests<br>• Plugin integration tests |
Agenix.Validation.Binary.Tests | Binary validation module testing | • Binary comparison tests<br>• File validation tests |
Agenix.Validation.Json.Tests | JSON validation module testing | • Schema validation tests<br>• JSON comparison tests |
Agenix.Validation.NHamcrest.Tests | Hamcrest matcher testing | • Matcher behavior tests<br>• Assertion tests |
Agenix.Validation.Text.Tests | Text validation module testing | • Text comparison tests<br>• Pattern matching tests |
📋 Configuration & Support Files
Component | Purpose | Features |
---|---|---|
Solution Configuration | Project organization and build settings | • Multi-project solution<br>• Shared build configuration<br>• Dependency management |
IDE Settings | Development environment standardization | • Code style enforcement<br>• License header automation<br>• Shared formatting rules |
Templates | Code generation and standardization | • License header templates<br>• File templates<br>• Coding standards |
🎯 Framework Capabilities
Capability | Supported Modules | Use Cases |
---|---|---|
API Testing | Http, Core, Validation.Json | REST API validation, HTTP workflows |
Database Testing | Sql, Core, Validation.Text | Data validation, SQL execution |
BDD Testing | ReqnrollPlugin, Screenplay | Behavior-driven development |
Unit Testing | NUnit.Runtime, Core | Component testing, mocking |
Integration Testing | All modules | End-to-end workflows |
Data Validation | All Validation.* modules | Content verification, format checking |
Development Guidelines
🛠️ Prerequisites
- .NET 8.0 SDK or later
- JetBrains Rider or Visual Studio 2022 (recommended IDEs)
- Git for version control
- NuGet package manager
📝 Coding Standards
Naming Conventions
- Classes: PascalCase (
CustomerService
,HttpRequestBuilder
) - Methods: PascalCase (
PerformAs
,AnsweredBy
) - Properties: PascalCase (
Name
,RequestUrl
) - Fields: camelCase with underscore prefix for private (
_httpClient
,_connectionString
) - Constants: PascalCase (
MaxRetryCount
,DefaultTimeout
) - Interfaces: PascalCase with 'I' prefix (
IPerformable
,IQuestion<T>
)
Code Style
- File scoped namespaces for new files
- Primary constructors where appropriate (C# 12 feature)
- Expression-bodied members for simple implementations
- Nullable reference types enabled
- XML documentation for public APIs
🧪 Testing Guidelines
Test Structure
- Arrange-Act-Assert pattern for unit tests
- Given-When-Then structure for BDD scenarios
- Descriptive test names that explain the scenario
Test Categories
- Unit Tests: Fast, isolated, test single components
- Integration Tests: Test component interactions
- Acceptance Tests: End-to-end business scenarios using Screenplay pattern
🔧 Development Workflow
Branch Strategy
- master: Production-ready code
- develop: Integration branch for features
- feature/: Individual feature development
- bugfix/: Bug fixes
- release/: Release preparation
Commit Guidelines
- Use conventional commits format:
type(scope): description feat(screenplay): add question chaining support fix(http): resolve timeout issue in HttpClient docs(readme): update installation instructions test(validation): add binary comparison tests
📦 Dependencies
Core Dependencies
- NUnit 4.x: Primary testing framework
- NSubstitute/Moq: Mocking library
- Newtonsoft.Json: JSON processing
- System.Net.Http: HTTP client operations
Adding New Dependencies
- Evaluate necessity and alternatives
- Check license compatibility
- Add to appropriate project only
- Update documentation
🚀 Building and Testing
Local Development
# Restore packages
dotnet restore
# Build solution
dotnet build
# Run all tests
dotnet test
# Run specific test project
dotnet test Agenix.Screenplay.Tests
IDE Configuration
- EditorConfig settings are enforced
- ReSharper/Rider settings in
.sln.DotSettings
- License headers automatically applied using templates
📋 Pull Request Guidelines
Before Submitting
- All tests pass locally
- Code follows established conventions
- XML documentation added for public APIs
- License headers present in new files
- Breaking changes documented
PR Description Should Include
- What: Brief description of changes
- Why: Reason for the change
- How: Technical approach used
- Testing: How the change was tested
- Breaking Changes: Any breaking changes
🐛 Issue Reporting
When reporting issues, please include:
- Framework version
- Target framework (.NET version)
- Minimal reproduction case
- Expected vs actual behavior
- Environment details (OS, IDE, etc.)
🔒 Security Considerations
- No hardcoded credentials in code or tests
- Sensitive data should use configuration or environment variables
- Dependencies regularly updated for security patches
- Test data should not contain real customer information
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Agenix.Api (>= 0.1.0-alpha0120)
- NUnit (>= 4.3.2)
- System.Configuration.ConfigurationManager (>= 8.0.0)
- System.Formats.Asn1 (>= 8.0.1)
- System.Text.Json (>= 8.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
0.1.0 | 76 | 6/25/2025 |
0.1.0-master0001 | 103 | 6/18/2025 |
0.1.0-alpha0120 | 73 | 6/26/2025 |
0.1.0-alpha0112 | 75 | 6/25/2025 |
0.1.0-alpha0110 | 78 | 6/25/2025 |
0.1.0-alpha0108 | 77 | 6/24/2025 |
0.1.0-alpha0106 | 77 | 6/24/2025 |
0.1.0-alpha0104 | 78 | 6/24/2025 |
0.1.0-alpha0102 | 76 | 6/24/2025 |
0.1.0-alpha0100 | 79 | 6/24/2025 |
0.1.0-alpha0098 | 79 | 6/23/2025 |
0.1.0-alpha0096 | 77 | 6/23/2025 |
0.1.0-alpha0094 | 107 | 6/18/2025 |
0.1.0-alpha0091 | 116 | 6/2/2025 |