{"id":15425744,"url":"https://github.com/olegsych/fuzzy","last_synced_at":"2026-05-02T13:33:20.393Z","repository":{"id":47484559,"uuid":"105695957","full_name":"olegsych/fuzzy","owner":"olegsych","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-21T19:52:47.000Z","size":256,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-22T08:50:29.729Z","etag":null,"topics":["dotnet","dotnet-standard","fuzz-testing","unit-testing"],"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/olegsych.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-10-03T19:49:11.000Z","updated_at":"2021-08-30T00:40:41.000Z","dependencies_parsed_at":"2022-08-20T00:40:52.448Z","dependency_job_id":null,"html_url":"https://github.com/olegsych/fuzzy","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/olegsych/fuzzy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olegsych%2Ffuzzy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olegsych%2Ffuzzy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olegsych%2Ffuzzy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olegsych%2Ffuzzy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olegsych","download_url":"https://codeload.github.com/olegsych/fuzzy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olegsych%2Ffuzzy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32536577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T12:25:33.646Z","status":"ssl_error","status_checked_at":"2026-05-02T12:24:51.733Z","response_time":132,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["dotnet","dotnet-standard","fuzz-testing","unit-testing"],"created_at":"2024-10-01T17:53:37.872Z","updated_at":"2026-05-02T13:33:20.371Z","avatar_url":"https://github.com/olegsych.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build](https://img.shields.io/appveyor/ci/olegsych/fuzzy/master)](https://ci.appveyor.com/project/olegsych/fuzzy/branch/master)\n[![Tests](https://img.shields.io/appveyor/tests/olegsych/fuzzy/master)](https://ci.appveyor.com/project/olegsych/fuzzy/branch/master/tests)\n[![Nuget](https://img.shields.io/nuget/v/fuzzy.svg)](https://www.nuget.org/packages/fuzzy)\n\nFuzzy is a simple .NET API for fuzz testing, or more specifically, for generating fuzzy inputs in unit tests.\n\nWhy use fuzz testing? To prevent system under test from making incorrect assumptions about its inputs and\nmake the unit tests more robust. Using `Fuzzy` for built-in and custom types in your unit tests also helps\nto make them smaller and cleaner.\n\n# install\n\nAdd the [fuzzy](https://www.nuget.org/packages/fuzzy) package to your .NET project.\n```PowerShell\ndotnet add package fuzzy\n```\n\n# import\n\nImport the `Fuzzy` namespace in your .NET source file.\n```C#\nusing Fuzzy;\n```\n\n# use\n\nCreate an `IFuzz` instance. Fuzzy is a fluent API starting with this interface.\n\n```C#\nIFuzz fuzzy = new RandomFuzz();\n```\n\nTo get a fuzzy value of a type you need, look for an `IFuzz` extension method with the name of the type.\n\n```C#\nint foo = fuzzy.Int32();\ndouble bar = fuzzy.Double();\nstring baz = fuzzy.String();\nUri qux = fuzzy.Uri();\nTypeCode quux = fuzzy.Enum\u003cTypeCode\u003e();\nTimeSpan quuz = fuzzy.TimeSpan();\nDateTime corge = fuzzy.DateTime();\n```\n\nFor supported types, you can also specify constraints, such as the minimum or the maximum value.\n```C#\nint foo = fuzzy.Int32().Minimum(41);\nint bar = fuzzy.Int32().Maximum(42);\nint baz = fuzzy.Int32().Between(41, 43);\n```\n\n`Fuzzy` can also create collections (`Array` or `List`) with fuzzy size and fuzzy elements.\n```C#\nint[] foo = fuzzy.Array(fuzzy.Int32);\n```\n\nIf needed, you can constrain collection size\n```C#\nint[] foo = fuzzy.Array(fuzzy.Int32, Length.Between(41, 43));\n```\n\nand collection elements.\n```C#\nint[] foo = fuzzy.Array(() =\u003e Environment.TickCount);\nint[] bar = fuzzy.Array(new[] { 41, 42, 43 });\n```\n\nWith collections, you can also get a fuzzy element or a fuzzy index.\n```C#\nIEnumerable\u003cstring\u003e elements = new[] { \"foo\", \"bar\", \"baz\" };\nstring element = fuzzy.Element(elements);\nint index = fuzzy.Index(elements);\n```\n\n# extend\n\nSuppose you have the following type in your application.\n```C#\nclass CustomType\n{\n    public int Foo;\n    public string Bar;\n}\n```\n\nIf you create an extension method like this.\n```C#\nstatic class IFuzzExtensions\n{\n    public static CustomType CustomType(this IFuzz fuzzy) =\u003e\n        new CustomType {\n            Foo = fuzzy.Int32(),\n            Bar = fuzzy.String(),\n        };\n}\n```\n\nThen, you can create fuzzy values of this custom types, just like the of types already supported by `Fuzzy`.\n```C#\nCustomType value = fuzzy.CustomType();\n```\n\nAnd, if you need fuzzy values of one of the .NET framework types, consider [contributing](./CONTRIBUTING.md) it to `Fuzzy`.\n\n# debug\n\nSometimes fuzzy test inputs can produce test results that are hard to understand or repeat. This is a sign that either\nyour tests or your system aren't handling a particular input correctly. You will need to correct this by making your\ntests handle this input specifically and possibly adjust your system code. In the meantime, you can replace the `RandomFuzz`\nwith the `SequentialFuzz` to make fuzzy values more predictable.\n```C#\nIFuzz fuzzy = new SequentialFuzz();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folegsych%2Ffuzzy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folegsych%2Ffuzzy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folegsych%2Ffuzzy/lists"}