loading...

SUT Factory

matheusrodrigues profile image Matheus Rodrigues Originally published at matheus.ro on ・1 min read

SUT factory may be a fancy name to what is basically a utility method, used to create an instance of the system under test. The main point of a SUT Factory is to reduce code duplication and improve maintainability of your unit tests suite.

I’ll show you a quick example of how can you implement this type of utility method.

Imagine a test like this one:

[TestMethod]
public void TestUsingConstructor()
{
    //Arrange
    MySUT sut = new MySUT();

    //Act
    //...Exercise the sut

    //Assert
    //...Verifying the results
}

Continue Reading...

Discussion

pic
Editor guide