I created an empty class library project containing only this class.
public class DictionaryDemo
{
private readonly Dictionary<string, int> dictionary = new Dictionary<string, int>();
public void Add(string key, int value)
{
this.dictionary.Add(key, value);
}
}
From this class, I generated a test project with Intellitest. Besides making a few formatting changes to the order for publication here, I have not edited this test project. This contains only the following Intellitest test.
[PexClass(typeof(DictionaryDemo)), TestClass]
public partial class DictionaryDemoTest
{
[PexMethod]
public void AddTest([PexAssumeUnderTest] DictionaryDemo target, string key, int value)
{
target.Add(key, value);
}
}
When I run the Intellitest method, I get the following results.



In fact, the tests created by themselves seem reasonable. I am not sure if low coverage indicates that more tests need to be created to cover the complexity of the dictionary, or if this is due to problems below.
. , Intellitest . , Intellitest dictionary dictionary. , [PexExplorableFromConstructor(typeof(DictionaryDemo))], ( ) , , , , DictionaryDemo, .
, , , .
, , ? Intellitest? Intellitest dictionary, . , ? , , ?
,
PexCreatable... PexExplorable... , [PexCreatableByConstructor(typeof(DictionaryDemo), MaySetRemainingFieldsByReflection = false)], , , .
factory DictionaryDemo .
[PexExplorableFromConstructor(typeof(Dictionary<string, int>))], .
VS 2015 VS 2017. RC.