Consider the following:
new SUT(null, null, new List<IObjectBeingMocked>() { mockObjectOne.Object, mockObjectTwo.Object })
My SUT (System Under Test) needs a list of objects as the third parameter. These need to be mocks as I've set some expectatioins on these.
How would I clear it up so that I can remove the need to call .Object
on each item in the list? There are only two items usually but this could grow and in my opinion this makes the test harder to read.
What would be the best way of transforming this list of mock objects into actual objects easily/nicely?