chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes
Is there any instance where reflective mocks do something that natural mocks cannot, or is there an instance where reflective mocks might be easier to use?
asked by howaldmg (1.9k points)

5 Answers

0 votes
Hi
There are things that can be done in reflective mocks but no in natural mocks.
For example you can mock private methods without using mstest private accessors.

As for the second question, Actually I think the Arrange Act Assert API
is better than both.

It gives you compile time check of the types, methods and arguments
plus you can fake private methods and properties.
It still has some features missing but we with every release we are filling the gaps.

So I would recommend using the Arrange Act Assert API and only if you are missing a feature use to the older API's
answered by ohad (35.4k points)
0 votes
Hi


As for the second question, Actually I think the Arrange Act Assert API
is better than both.

It gives you compile time check of the types, methods and arguments
plus you can fake private methods and properties.
It still has some features missing but we with every release we are filling the gaps.

So I would recommend using the Arrange Act Assert API and only if you are missing a feature use to the older API's


I second that
________
universal health
answered by nsoonhui (59.1k points)
0 votes
I was looking at the AAA API and I was thinking that would be a great way to go. My organization is stuck with the .NET 2.0 SP1 for right now however. I'm not sure that we're ready to upgrade to 3.5 right now. I have been getting ready to use those new features, but again, it's an organization-wide decision to begin to use that.

So, what features, specifically, would I get from natural mocks and reflective mocks that I would not get in the other?
answered by howaldmg (1.9k points)
0 votes
Hi
On a side note you can use the AAA API with VS2005.
Take a look here

As for Natural mocks VS. Reflective mocks take a look at the comparison table
You can see from the table that there are minor differences. Remember that you can mix both of API's in your tests so I would recommend you to use Natural mocks where possible and use Reflective mocks only when its really needed.
answered by ohad (35.4k points)
0 votes
First you'll need the .Net framework v3.5 installed on the machine. Can't get around that.


Yeah, VS2005 wasn't the issue. Putting .NET 3.5 on our build machines was the issue.


As for Natural mocks VS. Reflective mocks take a look at the comparison table


just what I needed!

I'll probably be pushing for us to upgrade to 3.5 soon, but for right now, 2.0 will have to do.
answered by howaldmg (1.9k points)
...