Skip to content

Latest commit

 

History

History
44 lines (35 loc) · 863 Bytes

GenericMethod.md

File metadata and controls

44 lines (35 loc) · 863 Bytes

Generic Methods

Demonstrates how Unitverse generates tests for generic methods

Source Type(s)

public class GenericSource
{
    public void DoStuff<T>(Guid g, DateTime dtParam, T theThing, int? thing2)
    {

    }
}

Generated Tests

public class GenericSourceTests
{
    private GenericSource _testClass;

    public GenericSourceTests()
    {
        _testClass = new GenericSource();
    }

    [Fact]
    public void CanCallDoStuff()
    {
        // Arrange
        var g = new Guid("8286d046-9740-a3e4-95cf-ff46699c73c4");
        var dtParam = DateTime.UtcNow;
        var theThing = "TestValue607156385";
        var thing2 = 1321446349;

        // Act
        _testClass.DoStuff<T>(g, dtParam, theThing, thing2);

        // Assert
        throw new NotImplementedException("Create or modify test");
    }
}