{"id":46127957,"url":"https://github.com/twenzel/nunit.extensions.helpers","last_synced_at":"2026-03-02T03:04:04.390Z","repository":{"id":256485200,"uuid":"855367797","full_name":"twenzel/NUnit.Extensions.Helpers","owner":"twenzel","description":"Helpers to generate NUnit tests","archived":false,"fork":false,"pushed_at":"2025-11-18T09:45:44.000Z","size":128,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-18T10:11:41.116Z","etag":null,"topics":["hacktoberfest","nunit","sourcegenerator"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"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/twenzel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-09-10T18:48:56.000Z","updated_at":"2025-11-18T09:42:16.000Z","dependencies_parsed_at":"2024-09-11T03:17:03.995Z","dependency_job_id":null,"html_url":"https://github.com/twenzel/NUnit.Extensions.Helpers","commit_stats":null,"previous_names":["twenzel/nunit.extensions.helpers"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/twenzel/NUnit.Extensions.Helpers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twenzel%2FNUnit.Extensions.Helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twenzel%2FNUnit.Extensions.Helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twenzel%2FNUnit.Extensions.Helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twenzel%2FNUnit.Extensions.Helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twenzel","download_url":"https://codeload.github.com/twenzel/NUnit.Extensions.Helpers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twenzel%2FNUnit.Extensions.Helpers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29991299,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["hacktoberfest","nunit","sourcegenerator"],"created_at":"2026-03-02T03:03:59.871Z","updated_at":"2026-03-02T03:04:04.380Z","avatar_url":"https://github.com/twenzel.png","language":"C#","readme":"# NUnit.Extensions.Helpers\n\n[![NuGet](https://img.shields.io/nuget/v/NUnit.Extensions.Helpers.svg)](https://nuget.org/packages/NUnit.Extensions.Helpers/)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![Build Status](https://github.com/twenzel/NUnit.Extensions.Helpers/workflows/CI/badge.svg?branch=main)](https://github.com/twenzel/NUnit.Extensions.Helpers/actions)\n\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=twenzel_NUnit.Extensions.Helpers\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=twenzel_NUnit.Extensions.Helpers)\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=twenzel_NUnit.Extensions.Helpers\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=twenzel_NUnit.Extensions.Helpers)\n[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=twenzel_NUnit.Extensions.Helpers\u0026metric=security_rating)](https://sonarcloud.io/dashboard?id=twenzel_NUnit.Extensions.Helpers)\n[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=twenzel_NUnit.Extensions.Helpers\u0026metric=bugs)](https://sonarcloud.io/dashboard?id=twenzel_NUnit.Extensions.Helpers)\n[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=twenzel_NUnit.Extensions.Helpers\u0026metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=twenzel_NUnit.Extensions.Helpers)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=twenzel_NUnit.Extensions.Helpers\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=twenzel_NUnit.Extensions.Helpers)\n\n\nHelpers to generate NUnit tests\n\n\u003e This is not an official [NUnit](https://github.com/nunit/nunit) package.\n\n## Install\n\nAdd the NuGet package [NUnit.Extensions.Helpers](https://nuget.org/packages/NUnit.Extensions.Helpers/) to any project supporting .NET Standard 2.0 or higher.\n\n\u003e \u0026gt; dotnet add package NUnit.Extensions.Helpers\n\n### Information\n\n\u003e Currently the generated source requires [Moq](https://nuget.org/packages/Moq) and [Shouldly](https://nuget.org/packages/Shouldly).\n\n## Usage\n\n### Constructor parameter null tests\n\nUse the `GenerateConstructorParameterNullTests` attribute to define the SUT (class which should be tested) to generate constructor parameter tests for.\n\n```csharp\n[GenerateConstructorParameterNullTests(typeof(Document))]\ninternal partial class DocumentTests\n{\n    [Test]\n    public void Test1()\n    {\n        Assert.Pass();\n    }\n}\n```\n\nIf the SUT looks like\n\n```csharp\npublic class Document\n{\n    private Stream _stream;\n    private IFileTester _fileTester;\n    private IOtherFilter _filter;\n\n    public Document(Stream myStream, IFileTester fileTester, IOtherFilter filter)\n    {\n        _stream = myStream ?? throw new ArgumentNullException(nameof(myStream));\n        _fileTester = fileTester ?? throw new ArgumentNullException(nameof(fileTester));\n        _filter = filter ?? throw new ArgumentNullException(nameof(filter));\n    }\n}\n```\n\nfollowing code will be generated:\n\n```csharp\npartial class DocumentTests\n{\n    [Test]\n    public void Throws_Exception_When_MyStream_Is_Null()\n    {\n        Action action = () =\u003e new Document(null, null, null);\n        action.ShouldThrow\u003cArgumentNullException\u003e().ParamName.Should().Be(\"myStream\");\n    }\n\n    [Test]\n    public void Throws_Exception_When_FileTester_Is_Null()\n    {\n        Action action = () =\u003e new Document(Mock.Of\u003cSystem.IO.Stream\u003e(), null, null);\n        action.ShouldThrow\u003cArgumentNullException\u003e().ParamName.Should().Be(\"fileTester\");\n    }\n\n    [Test]\n    public void Throws_Exception_When_Filter_Is_Null()\n    {\n        Action action = () =\u003e new Document(Mock.Of\u003cSystem.IO.Stream\u003e(), Mock.Of\u003cSample.IFileTester\u003e(), null);\n        action.ShouldThrow\u003cArgumentNullException\u003e().ParamName.Should().Be(\"filter\");\n    }\n}\n\n```\n\n#### Options\n\nIt's possible to generate a nested class with the `AsNestedClass` argument.\n\n```csharp\n[GenerateConstructorParameterNullTests(typeof(Document), AsNestedClass = true)]\ninternal partial class TestWithNested\n{\n}\n```\n\n### Web service tests\n\nUse the `WebServiceTester` helper class. This class reads the OpenApi documentation and can execute arbitary tests.\n\n```csharp\n[Test]\npublic async Task TestEndpointSecurity()\n{\n    var tester = new WebServiceTester(\"swagger.json\");\n\n    await tester.VerifySecuredEndpointsRequiresAuthentication(httpClient, CancellationToken.None);\n}\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwenzel%2Fnunit.extensions.helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwenzel%2Fnunit.extensions.helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwenzel%2Fnunit.extensions.helpers/lists"}