Skip to content

Challenge

The challenge arises when unit and/or integration tests fail due to code changes, such as adding new properties to baseline classes or fixing bugs. Manually fixing each expected baseline and running failed tests individually is time-consuming.

Approach

The approach involves using .NET Incremental Generators to generate modified “StormPetrel” test copies that can update expected baselines in original tests. Developers can run these tests to automatically overwrite baselines, then manually review the changes for accuracy, significantly reducing development time.

Description

The solution comprises several components developed as NuGet packages. The StormPetrel.Generator package incrementally generates modified “StormPetrel” test copies with embedded Storm Petrel context code. When executed, these tests capture actual baselines, convert them to C# code using the VarDump package or ObjectDumper.NET package, and overwrite the expected baselines in the original tests or other files.

Key Features

  • Framework Support: Enhanced compatibility with leading test frameworks including XUnit, NUnit, and MSTest.
  • Variable Pair Configuration: Flexible configuration options for actual/expected variable pairs, accommodating multiple sets.
  • Customizable Algorithms: Provision for custom or configurable algorithms to generate or dump expected baselines, leveraging the Storm Petrel test execution context.
  • Baseline Instantiation: Comprehensive support for expected baselines instantiated within the test method or sourced from external methods with variable arguments.

Screenshots

Storm Petrel
Storm Petrel
StormPetrel
StormPetrel
StormPetrel
StormPetrel-Calculator

Result

The Storm Petrel .NET components streamline the process of updating expected baselines with minimal effort, expediting software development.

Get in Touch with Us

Please enter your name.
Please enter a subject.
Please enter a message.
Please agree to our Terms and Conditions and the Privacy Policy.

This site uses technical cookies and allows the sending of 'third-party' cookies. By continuing to browse, you accept the use of cookies. For more information, see our Privacy Policy.