Skip to content

markmccaigue/AutoRegress

Repository files navigation

AutoRegress

A tiny library for automating system regression tests.

Write test cases, not tests.

Build status

Use AutoRegress to create a snapshot of the results of your class methods on the file system and verify they remain constant as you make changes.

Usage

using AutoRegress;

// When the class is done
var foo  = new Foo();
Tester.StoreStateForClass(foo);

// ...
// Some refactoring later
// ...

var isUnchanged = Tester.CheckStateForClass(foo);
Assert.IsTrue(isUnchanged);

Wrappers

AutoRegress caches the serialised result of all public declared nullary instance methods, so for more complicated scenarios you can create wrapper classes around your objects to document your test cases and perform transformations.

public class ControllerWrapper
{
    public string GetUser()
    {
        int wellKnownValue = 5; // User 5 is Dave
        var controller = new UserController();
        var response = controller.Get(wellKnownValue);
        return response.Content.ReadAsStringAsync().Result;
    }
}    

About

A tiny library for automating regression tests.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages