GithubHelp home page GithubHelp logo

knizkar / shouldly Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shouldly/shouldly

0.0 1.0 0.0 50.55 MB

Should testing for .net - the way Asserting *Should* be!

Home Page: http://shouldly.readthedocs.org/en/latest

License: Other

C# 100.00%

shouldly's Introduction

Icon

Shouldly

Build Status NuGet NuGet Documentation Status

Join the chat at https://gitter.im/shouldly/shouldly

Shouldly is an assertion framework which focuses on giving great error messages when the assertion fails while being simple and terse.

This is the old Assert way:

Assert.That(contestant.Points, Is.EqualTo(1337));

For your troubles, you get this message, when it fails:

Expected 1337 but was 0

How it Should be:

contestant.Points.ShouldBe(1337);

Which is just syntax, so far, but check out the message when it fails:

contestant.Points should be 1337 but was 0

It might be easy to underestimate how useful this is. Another example, side by side:

Assert.That(map.IndexOfValue("boo"), Is.EqualTo(2));    // -> Expected 2 but was 1
map.IndexOfValue("boo").ShouldBe(2);                    // -> map.IndexOfValue("boo") should be 2 but was 1

Shouldly uses the code before the ShouldBe statement to report on errors, which makes diagnosing easier.

Read more about Shouldly and its features at http://docs.shouldly-lib.net/

Installation

You can install Shouldly by copying and pasting the following command into your Package Manager Console within Visual Studio (Tools > NuGet Package Manager > Package Manager Console).

Install-Package Shouldly

Contributing

Getting started with Git and GitHub

Once you're familiar with Git and GitHub, clone the repository and start contributing.

If you need inspiration for which issue to pick up have a look for the Jump-In label on issues which are put on issues which are ready to be picked up by anyone.

Pre-requisites for running on build server

Shouldly uses the source code to make its error messages better. Hence, on the build server you will need to have the "full" pdb files available where the tests are being run.

What is meant by "full" is that when you set up your "release" configuration in Visual Studio and you go to Project Properties > Build > Advanced > Debug, you should set it to "full" rather than "pdb-only".

History Change

A test results database (~50mb) got accidently commited in a972872888925205c9655cb540455d23d1891148, we removed this from history. The commit was only in master for <24 hours but if you happened to pull then you may need to reset master to get back in line

Icon

Star created by Luboš Volkov from The Noun Project

shouldly's People

Contributors

jakeginnivan avatar josephwoodward avatar pandawood avatar xerxesb avatar chaitanyagurrapu avatar urig avatar ilya-murzinov avatar sholland1 avatar samsalisbury avatar mgroves avatar amadeusw avatar yannisgu avatar alexarchive avatar gertjvr avatar julienfiaffe avatar andy-mcdowall-ptml avatar coderdennis avatar gabrielweyer avatar mleech avatar robertlyson avatar subsonic avatar yogiraja avatar taschmidt avatar phil-scott-78 avatar dragan avatar vorou avatar relentless avatar nbarbettini avatar caleb-vear avatar gitter-badger avatar

Watchers

Ondrej Svitek 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.