Documentation

Getting started


Welcome to Cepepito !

Cepepito is a Visual Studio extension. To use it, you should first make sure Visual Studio 2017 is installed on your machine. You should then install the extension on your machine. First download the extension:

Download Cepepito on visual studio marketplace

Once you’ve downloaded the extension, simply execute the downloaded file (it’s cepepito.vsix), it’ll launch the installer and install the extension.
When the installation is finished, you can launch Visual Studio, you should see a new menu called Cepepito appear in Visual Studio.

You can check your trial license information: open the Cepepito menu and click on License menu. It will pop up a screen similar to this:

Cepepito about

Congratulations, you can now start using Cepepito!

Tests execution


Cepepito provides several way to execute tests in your project:

launch from the code editor window
launch from the solution explorer
launch from the test runner window

Launch tests from the code editor window


To execute tests from the code editor: you must first open your test file.
Once your test file is open, you can execute a single test or all the tests present in the file.

Execute a single test

To execute a single test:

  • move your cursor on the test method declaration
  • press shift + ctrl + p (or right click with your mouse) to display Cepepito contextual menu
  • select Run test to run the test or Debug test to debug it.

Run test from editor

Execute all tests in document

To execute all the tests in document:

  • move the cursor so that it’s not on a particular test declaration
  • press shift + ctrl + p (or right click with your mouse) to display the contextual menu
  • select Run all tests in file to run the tests or Debug all tests in file to debug the tests.

Run tests from editor

Launch tests from the solution explorer


You can run and debug all the tests of a given solution or project by launching them from the solution explorer.

To launch the tests of a given project:

  • open the solution explorer window
  • right click on the project you want to launch the tests for
  • select Run tests to launch the tests or Debug tests to debug the tests

Run tests from solution explorer

Launch from the test runner window


To launch the tests from the test runner you must have already launched them once so that they appear in the test runner with their results.

Once they appear in the test runner results, you can relaunch a single test, some of them or relaunch them all.

Relaunch a single test

  • Click on the test you want to relaunch in the test runner window to highlight its name
  • Right click and select Run test to launch the test or Debug test to launch the debugger for this test
  • Alternatively you can also use the Run test and Debug test in the test runner toolbar to achieve the same result

Relaunch several test

  • Click on their parent node in the test runner window to highlight this node
  • Right click and select Run tests to launch the test or Debug tests to launch them with the debugger
  • Alternatively you can also use the Run tests and Debug tests in the test runner toolbar to achieve the same result

Relaunch all the previously executed tests

  • Click on the Test Results node in the test runner window
  • Right click and select Run tests to launch the test or Debug tests to launch them with the debugger
  • Alternatively you can also use the Run tests and Debug tests in the test runner toolbar to achieve the same result

Code generation


Cepepito provides you with two kind of code generation features:

  • it can generate the test skeleton for a given class
  • it can generate a mock definition for a given class

Test skeleton generation


The test skeleton feature works as follow:
Given a class containing public methods, it will generate a test skeleton file containing a Google Test method per public method (it will ask for the target project for this generated file upon creation).
The generated methods will be labeled as follow : [OriginalMethodName]Test

To generate the test skeleton:

  • In the code editor, move the cursor on an instance of the target class or directly on the class definition and hit shift + ctrl + p (or right click with the mouse)
  • On the displayed contextual menu, click Generate tests for class
  • On the displayed pop up, select the target project for the newly generated file
  • The test skeleton will open in the editor

Mock class generation


The mock generation feature generates a Google Mock definition for a given class (it’ll generate mock methods only for virtual methods). The generated mock can be generated in clipboard for easy copy/paste or in a new file. The generated mock class is called [OriginalClassName]Mock

To generate a mock:

  • In the code editor, move the cursor on an instanec of the target class or directly on the class definition and hit shift + ctrl + p (or right click with the mouse)
  • On the displayed contextual menu, click Generate mock in clipboard to generate the mock in clipboard or Generate mock in file to generate the mock in a file
  • If you generated the mock in clipboard, simple press ctrl + v to paste the mock content
  • If you generated the mock in a new file, select the target project for the generated mock
  • The newly generated mock will be opened in the code editor

Test runner


When you launch or debug tests using Cepepito, the results are displayed in the test runner window. Below’s a screenshot of this window with details for each part of the window.

Cepepito test runner

Thank you for using Cepepito, if you have any question, just let us know!