Pex - Automated Whitebox Testing for .NET : Generic Parameterized Unit Testing

Generic Parameterized Unit Tests


Parameterized unit tests can be generic methods. In that case, the user has to specify the types used to instantiate the method using the PexGenericArguments attribute.

[PexClass]
public partial class ListTest {
    [PexMethod]
    [PexGenericArguments(typeof(int))]
    [PexGenericArguments(typeof(object))]
    public void AddItem<T>(List<T> list, T value)
    { ... }
}

See Also
PexMethodAttribute
(c) Microsoft Corporation. All rights reserved. pex Wiki Documentation 0.93.50813.0