Click here to Skip to main content
16,005,236 members
Articles / Programming Languages / C#

Mocking Expressions

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
8 Aug 2020CPOL3 min read 9.4K   2  
Mocking/stubbing lambda expressions to have a bit more control over our unit tests
Here we look at: What is an Expression and how to use it. Then we look at some examples of expressions like Simple, Reusable, and Advanced. We also look at a mocking scenario where I tell the stubbing framework to expect any kind of expression. Then finally we look at the solution, where I show how we can write more specific unit tests that are more resilient to changes or false negatives.

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Romania Romania
When asked, I always see myself as a .Net Developer because of my affinity for the Microsoft platform, though I do pride myself by constantly learning new languages, paradigms, methodologies, and topics. I try to learn as much as I can from a wide breadth of topics from automation to mobile platforms, from gaming technologies to application security.

If there is one thing I wish to impart, that that is this "Always respect your craft, your tests and your QA"

Comments and Discussions