{"id":27215373,"url":"https://github.com/sayfulla000/soenneker.fixtures.integration","last_synced_at":"2025-04-10T04:15:25.782Z","repository":{"id":286136372,"uuid":"960452603","full_name":"sayfulla000/soenneker.fixtures.integration","owner":"sayfulla000","description":"Provides a reusable and generic integration test xunit fixture that dynamically registers and configures WebApplicationFactory instances for multiple ASP.NET Core projects with support for custom app settings, authentication, logging, and test utilities.","archived":false,"fork":false,"pushed_at":"2025-04-10T04:01:37.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T04:15:22.387Z","etag":null,"topics":["csharp","dotnet","fixture","fixtures","integration","integrationfixture","integrations","tests","util","xunit"],"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/sayfulla000.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:10:02.000Z","updated_at":"2025-04-10T04:01:41.000Z","dependencies_parsed_at":"2025-04-04T15:28:42.557Z","dependency_job_id":"fd44bd15-c243-452a-90a4-5cffc6e6e8a2","html_url":"https://github.com/sayfulla000/soenneker.fixtures.integration","commit_stats":null,"previous_names":["sayfulla000/soenneker.fixtures.integration"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sayfulla000%2Fsoenneker.fixtures.integration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sayfulla000%2Fsoenneker.fixtures.integration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sayfulla000%2Fsoenneker.fixtures.integration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sayfulla000%2Fsoenneker.fixtures.integration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sayfulla000","download_url":"https://codeload.github.com/sayfulla000/soenneker.fixtures.integration/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154989,"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","fixture","fixtures","integration","integrationfixture","integrations","tests","util","xunit"],"created_at":"2025-04-10T04:15:24.955Z","updated_at":"2025-04-10T04:15:25.742Z","avatar_url":"https://github.com/sayfulla000.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"```markdown\n# 🧪 Soenneker Fixtures Integration\n\n![.NET](https://img.shields.io/badge/.NET-6.0-blue) ![XUnit](https://img.shields.io/badge/xUnit-2.4.1-blue) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/sayfulla000/soenneker.fixtures.integration)\n\nWelcome to the Soenneker Fixtures Integration repository! This project provides a reusable and generic integration test xUnit fixture. It dynamically registers and configures `WebApplicationFactory` instances for multiple ASP.NET Core projects. With support for custom app settings, authentication, logging, and test utilities, this library is designed to simplify your testing experience.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Configuration Options](#configuration-options)\n- [Example](#example)\n- [Contributing](#contributing)\n- [License](#license)\n- [Links](#links)\n\n## Features\n\n- **Reusable Fixtures**: Easily create and share integration test fixtures across multiple projects.\n- **Dynamic Configuration**: Automatically configure the `WebApplicationFactory` based on your project's requirements.\n- **Support for Custom Settings**: Use your application's configuration settings, making it easier to integrate into your existing workflows.\n- **Authentication**: Simplify the process of authenticating users in your tests.\n- **Logging Utilities**: Integrate logging capabilities to help diagnose issues during testing.\n- **Test Utilities**: Leverage built-in utilities that enhance the testing process.\n\n## Installation\n\nTo get started with Soenneker Fixtures Integration, follow these steps:\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/sayfulla000/soenneker.fixtures.integration.git\n   ```\n\n2. Navigate into the project directory:\n\n   ```bash\n   cd soenneker.fixtures.integration\n   ```\n\n3. Add the NuGet package to your project:\n\n   ```bash\n   dotnet add package Soenneker.Fixtures.Integration\n   ```\n\n4. Restore your project dependencies:\n\n   ```bash\n   dotnet restore\n   ```\n\n## Usage\n\nAfter installation, you can easily integrate the fixture into your xUnit tests. Here’s how you can do that:\n\n### Step 1: Create a Test Class\n\nStart by creating a test class in your project.\n\n```csharp\npublic class MyIntegrationTests : IClassFixture\u003cMyCustomFixture\u003e\n{\n    private readonly MyCustomFixture _fixture;\n\n    public MyIntegrationTests(MyCustomFixture fixture)\n    {\n        _fixture = fixture;\n    }\n\n    [Fact]\n    public async Task Test1()\n    {\n        var client = _fixture.CreateClient();\n        // Write your test logic here\n    }\n}\n```\n\n### Step 2: Implement the Fixture\n\nYour fixture should inherit from the `WebApplicationFactory\u003cTStartup\u003e` class.\n\n```csharp\npublic class MyCustomFixture : WebApplicationFactory\u003cStartup\u003e\n{\n    protected override void ConfigureWebHost(IWebHostBuilder builder)\n    {\n        // Custom configurations go here\n    }\n}\n```\n\n## Configuration Options\n\n### App Settings\n\nYou can define custom app settings in your test fixture. These settings will override the default ones during testing.\n\n```csharp\npublic class MyCustomFixture : WebApplicationFactory\u003cStartup\u003e\n{\n    protected override void ConfigureWebHost(IWebHostBuilder builder)\n    {\n        builder.ConfigureAppConfiguration((context, config) =\u003e\n        {\n            config.AddJsonFile(\"appsettings.Test.json\");\n        });\n    }\n}\n```\n\n### Authentication\n\nTo configure authentication, you can set up a test user in your fixture.\n\n```csharp\nprotected override void ConfigureWebHost(IWebHostBuilder builder)\n{\n    builder.ConfigureServices(services =\u003e\n    {\n        // Add authentication services\n        services.AddAuthentication(\"Test\")\n            .AddCookie(\"Test\", options =\u003e {\n                options.Events.OnValidatePrincipal = context =\u003e {\n                    // Add test user logic\n                    return Task.CompletedTask;\n                };\n            });\n    });\n}\n```\n\n### Logging\n\nYou can also set up logging to help with diagnosing issues.\n\n```csharp\nprotected override void ConfigureWebHost(IWebHostBuilder builder)\n{\n    builder.ConfigureLogging(logging =\u003e\n    {\n        logging.ClearProviders();\n        logging.AddConsole();\n    });\n}\n```\n\n## Example\n\nHere's a full example of a test using the fixture:\n\n```csharp\npublic class MyIntegrationTests : IClassFixture\u003cMyCustomFixture\u003e\n{\n    private readonly HttpClient _client;\n\n    public MyIntegrationTests(MyCustomFixture fixture)\n    {\n        _client = fixture.CreateClient();\n    }\n\n    [Fact]\n    public async Task Get_Endpoint_Returns_Success()\n    {\n        var response = await _client.GetAsync(\"/api/values\");\n        response.EnsureSuccessStatusCode();\n\n        var responseBody = await response.Content.ReadAsStringAsync();\n        Assert.Contains(\"expectedValue\", responseBody);\n    }\n}\n```\n\n## Contributing\n\nContributions are welcome! Please follow these steps:\n\n1. Fork the repository.\n2. Create a new branch: `git checkout -b feature/YourFeature`.\n3. Make your changes.\n4. Test your changes.\n5. Submit a pull request.\n\nFor larger contributions, please open an issue to discuss what you want to work on.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Links\n\nFor releases, please visit the following link:\n\n[![Latest Release](https://img.shields.io/badge/Latest%20Release-Click%20Here-brightgreen)](https://github.com/sayfulla000/soenneker.fixtures.integration/releases)\n\nExplore the releases for the latest updates, features, and fixes.\n\n## Conclusion\n\nSoenneker Fixtures Integration simplifies integration testing for ASP.NET Core applications. It provides powerful, customizable features while maintaining ease of use. We hope this project meets your testing needs and improves your development workflow.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsayfulla000%2Fsoenneker.fixtures.integration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsayfulla000%2Fsoenneker.fixtures.integration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsayfulla000%2Fsoenneker.fixtures.integration/lists"}