今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Using mocks, stubs, and fakes in API testing
- [Instructor] You might have heard about terms like mocks, stubs or fakes in relation to unit testing before. If those are scary terms to you, don't worry. In this video, we'll dig into them and I'll help you understand what they mean and also how you can effectively use them in your API testing. So first, let's start with some definitions. What do we mean by these things? Well, just like how in a movie, an actor might have a stunt double, so in testing, we can have test doubles. These are things that we can use to stand in for some real part of the system. This is what we're talking about when we talk about mocks, stubs and fakes. Mocking lets you replace a real implementation with a fake one. This can be helpful if you're trying to check one part of an API, but you need some data from elsewhere, maybe even from a third-party service, and you don't want to or can't use that service in your testing environment. In a…