chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male

Let’s Start Unit Testing!


Watch this video or follow the three steps below to get started:

First Step: Creating a New Test Project

  1. Open Visual Studio and create a new ‘Test Project’.

 

2. Click on ‘Project’, then click ‘Add Reference’.

3. Add ‘Typemock Isolator core DLL’ and ‘Typemock Isolator C# API’

Second Step: Writing Unit Tests

A good unit test should include these three components:

  1. Arrange – Set up your faked object’s behavior
  2. Act – Call your test code
  3. Assert – Make sure that the tests were called

In the new test project you opened in Visual Studio, go to UnitTest1.cs in the ‘Solution’ column and add the following test code to the beginning of the file:

Add the Isolated attribute to the test class:

Third Step: learn more

Check out our documentation and explore the examples folder (you can find it in your Typemock installation folder).

We are here to assist you every step of the way, so feel free to contact us at support@typemock.com