Popularity
6.4
Declining
Activity
3.9
-
803
52
183

Code Quality Rank: L5
Programming language: C#
License: MIT License
Tags: Test     Unit     Testing     TDD     MSpec     BDD     Context     Specification    
Latest version: v1.0.0

Machine.Specifications alternatives and similar packages

Based on the "Testing" category.
Alternatively, view Machine.Specifications alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of Machine.Specifications or a related project?

Add another 'Testing' Package

README

Machine.Specifications

Docs Nuget Discussions Gitter License

MSpec is called a "context/specification" test framework because of the "grammar" that is used in describing and coding the tests or "specs". The grammar reads roughly like this

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.

You should be able to see the components of the traditional Arrange-Act-Assert model in there. To support readability and remove as much "noise" as possible, MSpec eschews the traditional attribute-on-method model of test construction. Instead it uses custom delegates that you assign anonymous methods, and asks you to name them following a certain convention.

using Machine.Specifications;

[Subject("Authentication")]
class When_authenticating_an_admin_user
{
    static SecurityService subject;
    static UserToken user_token;

    Establish context = () => 
        subject = new SecurityService();

    Because of = () =>
        user_token = subject.Authenticate("username", "password");

    It should_indicate_the_users_role = () =>
        user_token.Role.ShouldEqual(Roles.Admin);

    It should_have_a_unique_session_id = () =>
        user_token.SessionId.ShouldNotBeNull();
}

Getting Started

  1. Create a .NET Framework or .NET Core library project.
  2. Install Nuget packages as follows:
Install-Package Machine.Specifications
  1. Install the test SDK and Visual Studio runner:
Install-Package Microsoft.NET.Test.SDK
Install-Package Machine.Specifications.Runner.VisualStudio
  1. Optionally, install the assert and mocking libraries:
Install-Package Machine.Specifications.Should
Install-Package Machine.Fakes

Documentation

For project documentation, please visit the wiki.

Training

A PluralSight course by @kevinkuebler is available here.

Get in touch

Discuss with us on Discussions, chat with us on Gitter, or raise an issue.

Discussions Gitter

Packages

Project Build NuGet
Machine.Specifications Build
Machine.Specifications.Reporting Build
Machine.Specifications.Runner.Console Build
Machine.Specifications.Runner.ReSharper Build
Machine.Specifications.Runner.Rider Build
Machine.Specifications.Runner.TDNet Build
Machine.Specifications.Runner.Utility Build
Machine.Specifications.Runner.VisualStudio Build
Machine.Specifications.Should Build
Machine.Fakes Build


*Note that all licence references and agreements mentioned in the Machine.Specifications README section above are relevant to that project's source code only.