Logo

A unit test generation extension for Visual Studio that aims to always produce code that compiles - covering the basic cases automatically and preparing as much as it can for the complex cases.

Get the extension from the Visual Studio Marketplace:

Alternatively see the releases on GitHub:

Examples Overview

This section contains examples of the output that Unitverse outputs, refreshed every build. Each example aims to demonstrate a particular scenario which is described in the following table.

Example Description
Abstract Classes Demonstrates how Unitverse generates tests when the source class is abstract or contains protected methods, as well as how inheritance chains are accounted for
Async Methods Demonstrates how tests are generated for async methods, as well as showing how the assertion framework is driven differently for async methods
AutoFixture Mock Generation Demonstrates how constructor dependencies can be configured using AutoFixture, and mock configuration calls can still be generated
Automatic Mock Generation Demonstrates how dependencies injected into constructors are tracked, and mock configuration calls emitted for any detected dependencies
Constrained Generic Types Demonstrates how appropriate types are selected for the generation of tests for generic types with type constraints
Delegate Generation Demonstrates how Unitverse generates default values for method parameters when the parameter is a delegate type
Extension Methods Demonstrates how Unitverse generates tests for extension methods
Frameworks - Fluent Assertions Demonstrates how tests are generated using XUnit for the test framework and NSubstitute for the mocking framework. Also shows using FluentAssertions for the assertion framework.
Frameworks - MSTest & Moq Demonstrates how tests are generated using MsTest for the test framework and Moq for the mocking framework
Frameworks - MSTest & Moq (with Moq.AutoMock) Demonstrates how tests are generated using MsTest for the test framework and Moq for the mocking framework, using Moq.AutoMock for object creation
Frameworks - NUnit 3 & FakeItEasy Demonstrates how tests are generated using NUnit 3 for the test framework and FakeItEasy for the mocking framework
Frameworks - XUnit & JustMock Demonstrates how tests are generated using XUnit for the test framework and JustMock for the mocking framework
Frameworks - XUnit & NSubstitute Demonstrates how tests are generated using XUnit for the test framework and NSubstitute for the mocking framework
Generic Methods Demonstrates how Unitverse generates tests for generic methods
IComparable Demonstrates the tests generated for a type that implements IComparable
IEquatable Demonstrates the tests generated for a type that implements IEquatable
Indexers Demonstrates the tests generated for a type that contains an indexer
Mapping Methods Shows how unitverse generates a test to verify mappings between input parameter type and return type where the types share property names
Multiple Overloads Shows how unitverse generates unambiguous names for methods that test multiple overloads of the same source method
Nullable Reference Types Shows how Unitverse will omit null tests for parameters declared to explicitly accept null
Operator Overloading Shows how Unitverse emits tests for declared unary and binary operators
POCO Initialization Demonstrates how test values are produced to initialize POCO members when the type is consumed
Property Initialization Checks Demonstrates how properties that have matching constructor parameters are checked that they are initialized automatically
Record Types (init Properties) Demonstrates the tests generated for a record type that has properties that have init accessors
Record Types (Primary Constructor) Demonstrates the tests generated for a simple primary constructor record type
ref & out Parameters Demonstrates the tests that Unitverse emits when methods contain ref or out parameters
Simple POCO Demonstrates how tests are generated for a simple POCO type
Singletons Demonstrates how Unitverse attempts to use a static property to get a type instance when the constructor is private
Static Classes Demonstrates how Unitverse generates tests when the source class is static
StyleCop Compatbility Demonstrates how tests can be generated with XML documentation and this. prefixed to test class fields
Value Generation Demonstrates how random values are created when required
Value Generation (with AutoFixture) Demonstrates how Unitverse can be configured to work with AutoFixture for test value generation