Git Product home page Git Product logo

machine.specifications's Introduction

Machine.Specifications

Docs Nuget Discussions License

MSpec logo

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, or raise an issue.

Discussions

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

machine.specifications's People

Contributors

agross avatar danielmarbach avatar aaronjensen avatar jlewallen avatar robertcoltheart avatar ivanz avatar einari avatar kropp avatar dependabot[bot] avatar drauch avatar nielshanberg avatar developwithpassion avatar smaclell avatar olsonjeffery avatar meinsiedler avatar hhariri avatar rho24 avatar ulrichb avatar saintgimp avatar leemhenson avatar brunojuchli avatar barrywoods avatar cprieto avatar dannyvincent avatar citizenmatt avatar sksbrg avatar anthonymastrean avatar am5800 avatar alexzeitler avatar feodorfitsner avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.