Hi,
I'm trying to mock a Dictionary.TryGetValue method based on what's described in this thread to no avail.
What I've tried so far:
var dictionary = Mock.Create<Dictionary<string, HashSet<SomeClass>>>();
HashSet<
SomeClass
> expected = new HashSet<
SomeClass
>();
expected.Add(new SomeClass(param1, param2));
Mock.Arrange(() => dictionary.TryGetValue(Arg.AnyString, out expected)).Returns(true);
However, when ever I run the test, I get a null in the out object.
To give some context, not sure it impacts or not, the test spans a service running in a separate thread. The mocked dictionary is successfully inserted via a PrivateAccessor.
Thanks in advance,
JP