{"id":13431837,"url":"https://github.com/shouldly/shouldly","last_synced_at":"2025-05-11T11:13:28.363Z","repository":{"id":1028004,"uuid":"856112","full_name":"shouldly/shouldly","owner":"shouldly","description":"Should testing for .NET—the way assertions should be!","archived":false,"fork":false,"pushed_at":"2025-05-06T16:06:20.000Z","size":24655,"stargazers_count":3151,"open_issues_count":96,"forks_count":420,"subscribers_count":66,"default_branch":"master","last_synced_at":"2025-05-11T11:13:18.245Z","etag":null,"topics":["assertion","should","testing","unit"],"latest_commit_sha":null,"homepage":"https://docs.shouldly.org","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shouldly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.txt","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},"funding":{"open_collective":"shouldly"}},"created_at":"2010-08-23T07:50:00.000Z","updated_at":"2025-05-11T07:58:36.000Z","dependencies_parsed_at":"2024-03-18T20:23:46.641Z","dependency_job_id":"9e408961-ba5c-4a3d-b471-7b14437b9785","html_url":"https://github.com/shouldly/shouldly","commit_stats":{"total_commits":1254,"total_committers":124,"mean_commits":"10.112903225806452","dds":0.7918660287081339,"last_synced_commit":"13a9b4064069547f7c0afdabaf3c2e844eb935f3"},"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shouldly%2Fshouldly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shouldly%2Fshouldly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shouldly%2Fshouldly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shouldly%2Fshouldly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shouldly","download_url":"https://codeload.github.com/shouldly/shouldly/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253554098,"owners_count":21926614,"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":["assertion","should","testing","unit"],"created_at":"2024-07-31T02:01:06.352Z","updated_at":"2025-05-11T11:13:28.345Z","avatar_url":"https://github.com/shouldly.png","language":"C#","readme":"![Shouldly Logo](https://raw.githubusercontent.com/shouldly/shouldly/master/assets/logo_350x84.png)  \n========\n\n[![CI](https://github.com/shouldly/shouldly/actions/workflows/CI.yml/badge.svg?branch=master)](https://github.com/shouldly/shouldly/actions/workflows/CI.yml)\n[![NuGet](https://img.shields.io/nuget/dt/shouldly.svg)](https://www.nuget.org/packages/Shouldly) \n[![NuGet](https://img.shields.io/nuget/vpre/shouldly.svg)](https://www.nuget.org/packages/Shouldly)\n[![Join the chat at https://gitter.im/shouldly/shouldly](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/shouldly/shouldly?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge) \n\nShouldly is an assertion framework which focuses on giving great error messages when the assertion fails while being simple and terse.\n\nThis is the old *Assert* way: \n```cs\nAssert.That(contestant.Points, Is.EqualTo(1337));\n```\nFor your troubles, you get this message, when it fails:\n\n    Expected 1337 but was 0\n\nHow it **Should** be:\n```cs\ncontestant.Points.ShouldBe(1337);\n```\nWhich is just syntax, so far, but check out the message when it fails:\n\n    contestant.Points should be 1337 but was 0\n\nIt might be easy to underestimate how useful this is. Another example, side by side:\n```cs\nAssert.That(map.IndexOfValue(\"boo\"), Is.EqualTo(2));    // -\u003e Expected 2 but was -1\nmap.IndexOfValue(\"boo\").ShouldBe(2);                    // -\u003e map.IndexOfValue(\"boo\") should be 2 but was -1\n```\n**Shouldly** uses the code before the *ShouldBe* statement to report on errors, which makes diagnosing easier.\n\nRead more about Shouldly and its features at https://docs.shouldly.org/.\n\n## Installation\n\nShouldly can be [found here on NuGet](https://www.nuget.org/packages/Shouldly/) and can be installed by copying and pasting the following command into your Package Manager Console within Visual Studio (Tools \u003e NuGet Package Manager \u003e Package Manager Console).\n\n```bash\nInstall-Package Shouldly\n```\n\nAlternatively if you're using .NET Core then you can install Shouldly via the command line interface with the following command:\n\n```bash\ndotnet add package Shouldly\n```\n\nTo have `ShouldMatchApproval` display a diff of the expected and actual files, you will need to install the `Shouldly.DiffEngine` package and configure it.\n\n```bash\nInstall-Package Shouldly.DiffEngine\n```\n\n```csharp\nShouldMatchConfiguration.ShouldMatchApprovedDefaults.ConfigureDiffEngine();\n```\n\n## Contributing\nContributions to Shouldly are very welcome. For guidance, please see [CONTRIBUTING.md](CONTRIBUTING.md)\n","funding_links":["https://opencollective.com/shouldly"],"categories":["Frameworks, Libraries and Tools",".NET","C# #","C\\#","Testing and Mocking","框架, 库和工具","Testing","C#","测试","🗒️ Cheatsheets","Identifiers"],"sub_categories":["Testing","测试","Misc","GUI - other","📦 Libraries"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshouldly%2Fshouldly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshouldly%2Fshouldly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshouldly%2Fshouldly/lists"}