What is Dummy used for in FakeItEasy? How does it differ from A.Fake or A.Ignored ?
Thanks 🙂
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A dummy isn’t really used for anything by FakeItEasy itself, it’s merely a way to create dummy instances that you can use in your tests.
For example, say that you want to test the following class:
Now, in one of your tests you want to invoke the bar method but the value that is passed to it is not important to the test, instead of writing:
You can write:
This signals that the value is really not important to the test so the whole reason for using it is to communicate intent better.