{"id":13431808,"url":"https://github.com/machine/machine.specifications","last_synced_at":"2025-03-16T12:31:32.700Z","repository":{"id":495409,"uuid":"122044","full_name":"machine/machine.specifications","owner":"machine","description":"Machine.Specifications is a Context/Specification framework for .NET that removes language noise and simplifies tests.","archived":false,"fork":false,"pushed_at":"2024-07-09T22:02:04.000Z","size":169312,"stargazers_count":886,"open_issues_count":29,"forks_count":178,"subscribers_count":47,"default_branch":"master","last_synced_at":"2024-10-01T02:49:47.025Z","etag":null,"topics":["dotnet","mspec","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/machine.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":"2009-02-05T03:04:48.000Z","updated_at":"2024-09-23T19:49:43.000Z","dependencies_parsed_at":"2024-06-19T09:55:53.961Z","dependency_job_id":"0637f6eb-2817-45ef-8f39-05ab0c36174b","html_url":"https://github.com/machine/machine.specifications","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machine%2Fmachine.specifications","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machine%2Fmachine.specifications/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machine%2Fmachine.specifications/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machine%2Fmachine.specifications/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/machine","download_url":"https://codeload.github.com/machine/machine.specifications/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221663619,"owners_count":16859867,"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":["dotnet","mspec","unit-testing"],"created_at":"2024-07-31T02:01:06.075Z","updated_at":"2025-03-16T12:31:32.683Z","avatar_url":"https://github.com/machine.png","language":"C#","readme":"# Machine.Specifications\n\n[![Docs](https://img.shields.io/badge/docs-wiki-blue.svg?style=for-the-badge)](https://github.com/machine/machine.specifications/wiki) [![Nuget](https://img.shields.io/nuget/dt/Machine.Specifications?style=for-the-badge)](https://www.nuget.org/packages/Machine.Specifications) [![Discussions](https://img.shields.io/badge/DISCUSS-ON%20GITHUB-orange?style=for-the-badge)](https://github.com/machine/machine.specifications/discussions) [![License](https://img.shields.io/github/license/machine/machine.specifications?style=for-the-badge)](https://github.com/machine/machine.specifications/blob/master/LICENSE)\n\n\u003cimg src=\"https://github.com/machine/machine.specifications/raw/master/src/Machine.Specifications/Resources/Machine.png\" alt=\"MSpec logo\" title=\"Machine.Specifications\" align=\"right\" height=\"100\" /\u003e\n\nMSpec is called a \"context/specification\" test framework because of the \"grammar\" that is used in describing and coding the\ntests or \"specs\". The grammar reads roughly like this\n\n\u003e When the system is in such a state, and a certain action occurs, it should do such-and-such or be in some end state.\n\nYou should be able to see the components of the traditional `Arrange-Act-Assert` model in there. To support readability\nand remove as much \"noise\" as possible, MSpec eschews the traditional attribute-on-method model of test construction.\nInstead it uses custom delegates that you assign anonymous methods, and asks you to name them following a certain convention.\n\n```csharp\nusing Machine.Specifications;\n\n[Subject(\"Authentication\")]\nclass When_authenticating_an_admin_user\n{\n    static SecurityService subject;\n    static UserToken user_token;\n\n    Establish context = () =\u003e \n        subject = new SecurityService();\n\n    Because of = () =\u003e\n        user_token = subject.Authenticate(\"username\", \"password\");\n\n    It should_indicate_the_users_role = () =\u003e\n        user_token.Role.ShouldEqual(Roles.Admin);\n\n    It should_have_a_unique_session_id = () =\u003e\n        user_token.SessionId.ShouldNotBeNull();\n}\n```\n\n## Getting Started\n1. Create a .NET Framework or .NET Core library project.\n2. Install Nuget packages as follows:\n\n```powershell\nInstall-Package Machine.Specifications\n```\n\n3. Install the test SDK and Visual Studio runner:\n\n```powershell\nInstall-Package Microsoft.NET.Test.SDK\nInstall-Package Machine.Specifications.Runner.VisualStudio\n```\n\n4. Optionally, install the assert and mocking libraries:\n\n```powershell\nInstall-Package Machine.Specifications.Should\nInstall-Package Machine.Fakes\n```\n\n## Documentation\n\nFor project documentation, please visit the [wiki](https://github.com/machine/machine.specifications/wiki).\n\n## Training\nA PluralSight course by [@kevinkuebler](https://github.com/kevinkuebler) is available [here](https://www.pluralsight.com/courses/expressive-testing-dotnet-mspec).\n\n## Get in touch\nDiscuss with us on [Discussions](https://github.com/machine/machine.specifications/discussions), or raise an [issue](https://github.com/machine/machine.specifications/issues).\n\n[![Discussions](https://img.shields.io/badge/DISCUSS-ON%20GITHUB-orange?style=for-the-badge)](https://github.com/machine/machine.specifications/discussions)\n\n## Packages\n\nProject | Build | NuGet\n-- | -- | --\n`Machine.Specifications` | [![Build](https://img.shields.io/github/workflow/status/machine/machine.specifications/build?style=flat-square)](https://github.com/machine/machine.specifications/actions?query=workflow:build) | [![](https://img.shields.io/nuget/v/Machine.Specifications.svg?style=flat-square)](https://www.nuget.org/packages/machine.specifications)\n`Machine.Specifications.Reporting` | [![Build](https://img.shields.io/github/workflow/status/machine/machine.specifications/build?style=flat-square)](https://github.com/machine/machine.specifications/actions?query=workflow:build) | [![](https://img.shields.io/nuget/v/Machine.Specifications.Reporting.svg?style=flat-square)](https://www.nuget.org/packages/machine.specifications.reporting)\n`Machine.Specifications.Runner.Console` | [![Build](https://img.shields.io/github/workflow/status/machine/machine.specifications/build?style=flat-square)](https://github.com/machine/machine.specifications/actions?query=workflow:build) | [![](https://img.shields.io/nuget/v/Machine.Specifications.Runner.Console.svg?style=flat-square)](https://www.nuget.org/packages/machine.specifications.runner.console)\n`Machine.Specifications.Runner.ReSharper` | [![Build](https://img.shields.io/github/workflow/status/machine/machine.specifications.runner.resharper/build?style=flat-square)](https://github.com/machine/machine.specifications.runner.resharper/actions?query=workflow:build) | [![](https://img.shields.io/resharper/v/Machine.Specifications.Runner.Resharper9.svg?style=flat-square)](https://plugins.jetbrains.com/plugin/11639-machine-specifications-for-resharper)\n`Machine.Specifications.Runner.Rider` | [![Build](https://img.shields.io/github/workflow/status/machine/machine.specifications.runner.resharper/build?style=flat-square)](https://github.com/machine/machine.specifications.runner.resharper/actions?query=workflow:build) | [![](https://img.shields.io/jetbrains/plugin/v/11528-machine-specifications.svg?style=flat-square\u0026label=rider)](https://plugins.jetbrains.com/plugin/11528-machine-specifications-for-rider)\n`Machine.Specifications.Runner.TDNet` | [![Build](https://img.shields.io/github/workflow/status/machine/machine.specifications/build?style=flat-square)](https://github.com/machine/machine.specifications/actions?query=workflow:build) | [![](https://img.shields.io/nuget/v/Machine.Specifications.Runner.TDNet.svg?style=flat-square)](https://www.nuget.org/packages/machine.specifications.runner.tdnet)\n`Machine.Specifications.Runner.Utility` | [![Build](https://img.shields.io/github/workflow/status/machine/machine.specifications/build?style=flat-square)](https://github.com/machine/machine.specifications/actions?query=workflow:build) | [![](https://img.shields.io/nuget/v/Machine.Specifications.Runner.Utility.svg?style=flat-square)](https://www.nuget.org/packages/machine.specifications.runner.utility)\n`Machine.Specifications.Runner.VisualStudio` | [![Build](https://img.shields.io/github/workflow/status/machine/machine.specifications.runner.visualstudio/build?style=flat-square)](https://github.com/machine/machine.specifications.runner.visualstudio/actions?query=workflow:build) | [![](https://img.shields.io/nuget/v/Machine.Specifications.Runner.VisualStudio.svg?style=flat-square)](https://www.nuget.org/packages/machine.specifications.runner.visualstudio)\n`Machine.Specifications.Should` | [![Build](https://img.shields.io/github/workflow/status/machine/machine.specifications/build?style=flat-square)](https://github.com/machine/machine.specifications/actions?query=workflow:build) | [![](https://img.shields.io/nuget/v/Machine.Specifications.Should.svg?style=flat-square)](https://www.nuget.org/packages/machine.specifications.should)\n`Machine.Fakes` | [![Build](https://img.shields.io/github/workflow/status/machine/machine.specifications.fakes/build?style=flat-square)](https://github.com/machine/machine.specifications.fakes/actions?query=workflow:build) | [![](https://img.shields.io/nuget/v/Machine.Fakes.svg?style=flat-square)](https://www.nuget.org/packages/machine.fakes)\n","funding_links":[],"categories":["Frameworks, Libraries and Tools","dotnet","C# #","框架, 库和工具","Testing","测试","Identifiers"],"sub_categories":["Testing","测试","GUI - other"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmachine%2Fmachine.specifications","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmachine%2Fmachine.specifications","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmachine%2Fmachine.specifications/lists"}