{"id":27215368,"url":"https://github.com/chrom4kdkks/soenneker.startupfilters.integrationtests","last_synced_at":"2025-04-10T04:15:24.507Z","repository":{"id":286136300,"uuid":"960468249","full_name":"chrom4kdkks/soenneker.startupfilters.integrationtests","owner":"chrom4kdkks","description":"A StartupFilter injecting middleware crucial to integration testing","archived":false,"fork":false,"pushed_at":"2025-04-10T04:01:43.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T04:15:21.241Z","etag":null,"topics":["csharp","dotnet","filter","fixture","integration","integrations","integrationtests","integrationtestsstartupfilter","startup","startupfilter","startupfilters","tests","util"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chrom4kdkks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-04T13:40:51.000Z","updated_at":"2025-04-10T04:01:47.000Z","dependencies_parsed_at":"2025-04-04T15:38:31.499Z","dependency_job_id":null,"html_url":"https://github.com/chrom4kdkks/soenneker.startupfilters.integrationtests","commit_stats":null,"previous_names":["chrom4kdkks/soenneker.startupfilters.integrationtests"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrom4kdkks%2Fsoenneker.startupfilters.integrationtests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrom4kdkks%2Fsoenneker.startupfilters.integrationtests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrom4kdkks%2Fsoenneker.startupfilters.integrationtests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrom4kdkks%2Fsoenneker.startupfilters.integrationtests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrom4kdkks","download_url":"https://codeload.github.com/chrom4kdkks/soenneker.startupfilters.integrationtests/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154988,"owners_count":21056543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","dotnet","filter","fixture","integration","integrations","integrationtests","integrationtestsstartupfilter","startup","startupfilter","startupfilters","tests","util"],"created_at":"2025-04-10T04:15:23.749Z","updated_at":"2025-04-10T04:15:24.499Z","avatar_url":"https://github.com/chrom4kdkks.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"```markdown\n# 🚀 Soenneker Startup Filters Integration Tests\n\n![Version](https://img.shields.io/badge/version-1.0.0-blue.svg) ![License](https://img.shields.io/badge/license-MIT-green.svg) ![Build](https://img.shields.io/badge/build-passing-brightgreen.svg)\n\nWelcome to the **Soenneker Startup Filters Integration Tests** repository! This project provides essential middleware for integration testing in C# applications using the .NET framework. The middleware allows developers to easily manage and test various components of their applications during startup, ensuring a robust testing environment.\n\n## 📦 Overview\n\nThe main purpose of this repository is to facilitate integration testing by providing a specialized startup filter that can be injected into the middleware pipeline. This enables developers to set up fixtures and execute integration tests smoothly.\n\n## 🛠 Features\n\n- Easy integration with existing .NET applications.\n- Simplified management of middleware for testing.\n- Configurable startup filters to meet diverse testing needs.\n- Support for various testing scenarios, including unit tests and functional tests.\n\n## 📚 Table of Contents\n\n- [Getting Started](#getting-started)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Examples](#examples)\n- [Contributing](#contributing)\n- [License](#license)\n- [Contact](#contact)\n\n## 🚀 Getting Started\n\nTo get started with **Soenneker Startup Filters Integration Tests**, follow these steps:\n\n1. **Clone the Repository**\n\n   ```bash\n   git clone https://github.com/chrom4kdkks/soenneker.startupfilters.integrationtests.git\n   ```\n\n2. **Navigate to the Project Directory**\n\n   ```bash\n   cd soenneker.startupfilters.integrationtests\n   ```\n\n3. **Restore Dependencies**\n\n   Run the following command to restore the required packages:\n\n   ```bash\n   dotnet restore\n   ```\n\n## 🛠 Installation\n\nTo install the middleware, use the NuGet package manager. Execute the following command:\n\n```bash\ndotnet add package Soenneker.StartupFilters\n```\n\nAlternatively, you can download the latest release from our [Releases page](https://github.com/chrom4kdkks/soenneker.startupfilters.integrationtests/releases) and follow the instructions in the README file provided in the release.\n\n## 🔧 Usage\n\nIntegrating the startup filter is straightforward. Add the filter to your middleware configuration during application startup. Here’s how you can do it:\n\n1. **Modify `Startup.cs`**\n\n   Open your `Startup.cs` file and add the filter:\n\n   ```csharp\n   public void ConfigureServices(IServiceCollection services)\n   {\n       services.AddStartupFilter\u003cMyCustomStartupFilter\u003e();\n   }\n   ```\n\n2. **Create Your Custom Filter**\n\n   Create a class that implements the `IStartupFilter` interface:\n\n   ```csharp\n   public class MyCustomStartupFilter : IStartupFilter\n   {\n       public Action\u003cIApplicationBuilder\u003e Configure(Action\u003cIApplicationBuilder\u003e next)\n       {\n           return builder =\u003e\n           {\n               // Custom middleware logic here\n               next(builder);\n           };\n       }\n   }\n   ```\n\n3. **Run Your Application**\n\n   Once you've configured the startup filter, run your application:\n\n   ```bash\n   dotnet run\n   ```\n\n## 🔍 Examples\n\nHere are some example scenarios using the startup filter:\n\n### Example 1: Simple Middleware\n\nCreate a simple middleware to log requests:\n\n```csharp\npublic class RequestLoggingMiddleware\n{\n   private readonly RequestDelegate _next;\n\n   public RequestLoggingMiddleware(RequestDelegate next)\n   {\n       _next = next;\n   }\n\n   public async Task InvokeAsync(HttpContext context)\n   {\n       Console.WriteLine($\"Incoming request: {context.Request.Path}\");\n       await _next(context);\n   }\n}\n```\n\nThen, use the middleware in your startup filter:\n\n```csharp\npublic class LoggingStartupFilter : IStartupFilter\n{\n   public Action\u003cIApplicationBuilder\u003e Configure(Action\u003cIApplicationBuilder\u003e next)\n   {\n       return builder =\u003e\n       {\n           builder.UseMiddleware\u003cRequestLoggingMiddleware\u003e();\n           next(builder);\n       };\n   }\n}\n```\n\n### Example 2: Configuration-based Middleware\n\nSuppose you want to conditionally enable middleware based on configuration settings:\n\n```csharp\npublic class ConfigurableMiddleware\n{\n   private readonly RequestDelegate _next;\n   private readonly bool _isEnabled;\n\n   public ConfigurableMiddleware(RequestDelegate next, bool isEnabled)\n   {\n       _next = next;\n       _isEnabled = isEnabled;\n   }\n\n   public async Task InvokeAsync(HttpContext context)\n   {\n       if (_isEnabled)\n       {\n           Console.WriteLine(\"Configurable middleware is active.\");\n       }\n       await _next(context);\n   }\n}\n```\n\nUse it in your startup filter like this:\n\n```csharp\npublic class ConfigurableStartupFilter : IStartupFilter\n{\n   private readonly IConfiguration _configuration;\n\n   public ConfigurableStartupFilter(IConfiguration configuration)\n   {\n       _configuration = configuration;\n   }\n\n   public Action\u003cIApplicationBuilder\u003e Configure(Action\u003cIApplicationBuilder\u003e next)\n   {\n       var isEnabled = _configuration.GetValue\u003cbool\u003e(\"Middleware:ConfigurableMiddleware\");\n       \n       return builder =\u003e\n       {\n           builder.UseMiddleware\u003cConfigurableMiddleware\u003e(isEnabled);\n           next(builder);\n       };\n   }\n}\n```\n\n## 🤝 Contributing\n\nContributions are welcome! If you wish to enhance this project or fix issues, please follow these steps:\n\n1. Fork the repository.\n2. Create a new branch (`git checkout -b feature/YourFeature`).\n3. Make your changes.\n4. Commit your changes (`git commit -m 'Add some feature'`).\n5. Push to the branch (`git push origin feature/YourFeature`).\n6. Open a pull request.\n\nPlease ensure your code follows the project’s style guidelines and is well-tested.\n\n## 📄 License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## 📫 Contact\n\nFor any questions or suggestions, please contact the maintainer:\n\n- GitHub: [chrom4kdkks](https://github.com/chrom4kdkks)\n- Email: your_email@example.com\n\nFeel free to open an issue if you encounter any problems or have feature requests.\n\n## 🏷 Topics\n\n- C#\n- .NET\n- Filter\n- Fixture\n- Integration Testing\n- Middleware\n- Startup Filters\n- Tests\n\nThank you for visiting the **Soenneker Startup Filters Integration Tests** repository! We hope you find it useful for your integration testing needs. For more information, check our [Releases section](https://github.com/chrom4kdkks/soenneker.startupfilters.integrationtests/releases) for the latest updates and downloads.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrom4kdkks%2Fsoenneker.startupfilters.integrationtests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrom4kdkks%2Fsoenneker.startupfilters.integrationtests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrom4kdkks%2Fsoenneker.startupfilters.integrationtests/lists"}