Dummies

Dummies are the simplest form of test double. A dummy has no appreciable functionality. We don't actually expect the dummy class or method to be used in the result of the class or method we are testing.

Dummies are most often used when the class you are testing has a dependency that the method or function you are testing does not use.

You create a dummy by creating a new copy or instance of a class or method and then doing absolutely nothing in the body of the code. Void methods will be empty and methods or functions expecting a return value will either throw when called or return the simplest form of that return value.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.4.181