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
0 votes
Looking for a work around for the following:

https://www.typemock.com/community/viewt ... =4864#4864
asked by boo (21.8k points)

6 Answers

0 votes
Hi Boo,

To follow up on other recent forum postings related to this: this feature (conditional behavior) is in our todo list and will be implemented for an upcoming version. In the meanwhile, you could use one of our older APIs to do this - this page describes how you do it in Natural Mocks: https://www.typemock.com/Docs/UserGuide/ ... tural.html. You can find that and more under our user's guide at https://www.typemock.com/Docs/UserGuide/index.php, under Using Typemock Isolator -> Previous Generation API. Again, we are committed to bring this capability to the AAA API.

Thanks,
Doron
Typemock Support
answered by doron (17.2k points)
0 votes
What is the time frame on this? I've spent the entire morning trying to get this to work in Natural and it's just been painful so I tried using a combination of reflective and AAA but that's not working either (mock.MockedInstance is returning null).

If it's going to be in the next 2-3 weeks I can live with an inconclusive test or two versus spending much more time trying to work around.

I'm assuming this new feature would be bundled with the feature of WasCalledWithArguments feature that would allow you to have that When logic of reflective mocks in AAA --- which is where I really need it.
answered by boo (21.8k points)
0 votes
Hi Brian,

Conditional Behavior feature is one of the next features that will be added to Isolator's AAA API, at this time I cannot give you exact estimate but I hope it will be available the next month.
answered by dhelper (11.9k points)
0 votes
Here's the work around I implemented for this lack of feature:
http://www.aaron-powell.com/blog/februa ... eters.aspx
answered by slace (2.4k points)
0 votes
Unfortunately in my case it's not as clear cut of a problem, but good tip and thought though to use extension methods.
answered by boo (21.8k points)
0 votes
Yeah, it's only useful if you can practically implement an extension method for what you are mocking (which I was able to do).

Otherwise we've got to wait until Typemock can get it implemented within the API ;)
answered by slace (2.4k points)
...