I am trying to create a unit test similar to how I would have done one in C# but am struggling with the lambdas in vb.
Bascially I am trying to mock a class and then create a stub and return. In C# I would have done something like;
MockedPersonRepository
.Stub(x => x.Find(id))
.Return(person)
But in visual basic I am trying to do a similar thing but can not work out the syntax
MockedPersonRepository.Stub(Function... argh!!!
Any advice on how to reproduce the above would be greatly appreciated!
Kind regards,
Dom
One easy example I typically show (as I’m a VB developer also) is the below: (for some odd reason in VB you need to pull this out into another function that returns nothing)
The above is for interaction based testing, the below might be closer to what you are looking for in your current example