Search Unity

How to use NSubstitute to create Test Doubles

Discussion in 'Community Learning & Teaching' started by charlesamat, Aug 17, 2017.

  1. charlesamat

    charlesamat

    Joined:
    Feb 5, 2014
    Posts:
    66


    Functions that rely on indirect input and output require test doubles to unit test. In Unity, test doubles are created using NSubstitute.

    In this video, I demonstrate how to import that NSubstitute DLL and create unit tests for a generic class called Player.

    ● Source Code: https://github.com/charlieamat/test-doubles-nsubstitute
    ● Principles of Solitary Unit Testing: https://josephdpurcell.github.io/principles-of-solitary-unit-testing/dist/2015-phpug
    ● Blog post: http://infalliblecode.com/use-nsubstitute-create-test-doubles-unity/
     
  2. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,933
    The "blog post" is nothing more or less than a link to the video you already posted?

    You got me; I hit your clickbait :). But no blog post there. Nevermind, closed and moved on.