У нас вы можете посмотреть бесплатно Interfaces 101 : Testing with a Mock Interface или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Episode 8! - Watch and learn how to mock server responses for unit tests. -- In this video, Miki will build an API client type for a web service. The type will have a method called `Health` that: Performs an HTTP request to a URL. Returns an error depending on the response code received from the server. Miki will then proceed by writing unit tests to verify if the client is working as intended. In lieu of a real server, Miki will create a new type that implements the `http.RoundTripper` interface and use it as the request’s transport during testing to manually specify the response code returned. Things you will learn in this video Perform an HTTP request with the Go STD library. Mock an HTTP response for unit tests. For the full course materials visit → https://github.com/ardanlabs/gotraini... -- Which aspects of your tests do you mock by taking advantage of Go interfaces? Comment below or tweet us on twitter & let us know, we want to hear from you! ~ If you found this video helpful, hit that like button & subscribe for more content like this. -- Access our online courses → https://ardanlabs.com/education Attending a live training → https://www.ardanlabs.com/live-traini... Other Links: Website: https://www.ardanlabs.com/ Github: https://github.com/ardanlabs Twitter: / ardanlabs