Giter VIP home page Giter VIP logo

test-doc's Introduction

test-doc README

Generate a markdown summary of your C# unit tests via a simple C# script (CSX script executed via dotnet script or CSI.exe).

  • currently supports NUnit based tests

Usage

test-doc is a CSX script (C# script). There are two main ways to execute a CSX script:

  • via dotnet script (.NET Core 6 or 7)
  • via CSI.exe (installed with Microsoft Visual Studio)

Usage - via dotnet script

  1. Check that .NET Core 6 or 7 is installed:

dotnet --version

  1. Install the 'script' tool of dotnet

dotnet tool install -g dotnet-script

  1. Build your unit tests and note the path to the assembly (the DLL file).

  2. Open a command prompt.

  3. CD to this directory

  4. Execute the C# script via dotnet script:

dotnet script test-doc.csx <path to the unit tests DLL>

This outputs a summary of all unit tests in markdown format.

Usage - via CSI.exe (installed with Microsoft Visual Studio)

  1. Build your unit tests and note the path to the assembly (the DLL file).

  2. Open a Developer Command Prompt. This is installed with Microsoft Visual Studio and you can search for it via Windows-Key + Q. OR if you have .NET Core 5 or 6 installed then csi may be available.

  3. CD to this directory

  4. Execute the C# script via CSI:

csi test-doc.csx <path to the unit tests DLL>

This outputs a summary of all unit tests in markdown format.

Example output

# Tests in MyCompany.Project1.MyApp.CoreTests

## Test class NumberParsingTests
- It_should_parse_a_number
- It_should_not_parse_a_date

## Test class InterestCalculator
- It_should_calculate_interest_for_one_year_at_10_percent
- It_should_calculate_interest_for_5_years_at_15_percent

Dependencies

The C# script requires tooling to execute the CSX script.

There are 2 options:

  1. [recommended] dotnet core and dotnet script

OR

  1. CSI to execute.

This is installed as part of Microsoft Visual Studio.

Compatibility

Tested with:

  • dotnet script (dotnet version 6.0.400)
  • Microsoft (R) Visual C# Interactive Compiler version 4.3.0-3.22401.3

The version of the tool (dotnet script or else CSI.exe) determines which .NET framework will be used to execute. This limits which .NET assemblies (DLL files) can be loaded for analysis.

So for example, if the CSI tool is .NET Core based, then it might not be able to load Windows specific .NET assemblies. In that case, it is beter to use dotnet script.

test-doc's People

Contributors

mrseanryan avatar

Watchers

 avatar  avatar  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.