lundi 29 juillet 2019

How to test a method that uses IEnumberables

I'm trying to test a method that takes in an object that has an IEnumberable property but don't know how to make that work in a test.

I've tried Mocking the property which failed because the object isn't mocked.

The method I want to test looks like:

myMethod(MyObject object)

The object has the property:

public IEnumerable<string> EnumProperty { get; set; }

I'm sure(and hoping) I'm just missing something really obvious.

Aucun commentaire:

Enregistrer un commentaire