Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 3.140.248.104
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
3 /
mockery /
mockery /
docs /
cookbook /
Delete
Unzip
Name
Size
Permission
Date
Action
big_parent_class.rst
1.63
KB
-rw-r--r--
2018-10-02 09:00
class_constants.rst
4.56
KB
-rw-r--r--
2018-10-02 09:00
default_expectations.rst
757
B
-rw-r--r--
2018-10-02 09:00
detecting_mock_objects.rst
394
B
-rw-r--r--
2018-10-02 09:00
index.rst
242
B
-rw-r--r--
2018-10-02 09:00
map.rst.inc
275
B
-rw-r--r--
2018-10-02 09:00
mockery_on.rst
2.98
KB
-rw-r--r--
2018-10-02 09:00
mocking_hard_dependencies.rst
3.33
KB
-rw-r--r--
2018-10-02 09:00
not_calling_the_constructor.rst
2.1
KB
-rw-r--r--
2018-10-02 09:00
Save
Rename
.. index:: single: Cookbook; Default Mock Expectations Default Mock Expectations ========================= Often in unit testing, we end up with sets of tests which use the same object dependency over and over again. Rather than mocking this class/object within every single unit test (requiring a mountain of duplicate code), we can instead define reusable default mocks within the test case's ``setup()`` method. This even works where unit tests use varying expectations on the same or similar mock object. How this works, is that you can define mocks with default expectations. Then, in a later unit test, you can add or fine-tune expectations for that specific test. Any expectation can be set as a default using the ``byDefault()`` declaration.