{"id":444476,"date":"2025-01-09T09:45:17","date_gmt":"2025-01-09T09:45:17","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=444476"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=444476","title":{"rendered":"<span>\u0422\u0438\u043f\u043e\u043b\u043e\u0433\u0438\u044f Test Doubles<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0443\u0431\u043b\u0451\u0440\u044b (<em>\u0430\u043d\u0433\u043b<\/em>. Test Doubles) \u2014 \u044d\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0438\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u0430\u0445 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u043c\u0435\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b (<em>\u0430\u043d\u0433\u043b. SUT, System Under Test<\/em>).<\/p>\n<ul>\n<li>\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0432\u0441\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0443\u0431\u043b\u0451\u0440\u044b \u043e\u0434\u043d\u0438\u043c \u0441\u043b\u043e\u0432\u043e\u043c: Mock.<\/p>\n<\/li>\n<li>\n<p>\u0414\u0440\u0443\u0433\u0438\u0435 \u0432\u044b\u0434\u0435\u043b\u044f\u044e\u0442 \u0440\u043e\u0432\u043d\u043e \u0434\u0432\u0430 \u0442\u0438\u043f\u0430: Stub \u0438 Mock \u2014 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u043e\u043d\u0438 \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u0442\u0430\u0442\u044c\u0451\u0439 <a href=\"https:\/\/martinfowler.com\/articles\/mocksArentStubs.html\" rel=\"noopener noreferrer nofollow\">Mocks Aren&#8217;t Stubs<\/a> \u041c\u0430\u0440\u0442\u0438\u043d\u0430 \u0424\u0430\u0443\u043b\u0435\u0440\u0430<\/p>\n<\/li>\n<li>\n<p>\u0422\u0440\u0435\u0442\u044c\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u044e\u0442 \u0446\u0435\u043b\u044b\u0445 \u043f\u044f\u0442\u044c \u0442\u0438\u043f\u043e\u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432 \u2014 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u043a\u043d\u0438\u0433\u0435 XUnit Test Patterns.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043e\u0431\u0441\u0443\u0434\u0438\u043c \u043f\u044f\u0442\u044c \u0442\u0438\u043f\u043e\u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432: Dummy, Stub, Spy, Mock, Fake.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5d8\/55d\/362\/5d855d36207f4972c96a09a866b2ba5a.png\" alt=\"\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u044f\u0442 \u0442\u0438\u043f\u043e\u043b\u043e\u0433\u0438\u044e \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432.\" title=\"\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u044f\u0442 \u0442\u0438\u043f\u043e\u043b\u043e\u0433\u0438\u044e \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432.\" width=\"780\" height=\"440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5d8\/55d\/362\/5d855d36207f4972c96a09a866b2ba5a.png\"\/><\/p>\n<div><figcaption>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u044f\u0442 \u0442\u0438\u043f\u043e\u043b\u043e\u0433\u0438\u044e \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432.<\/figcaption><\/div>\n<\/figure>\n<h2>\u041a\u0430\u043a \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0441\u0442\u0430\u0442\u044c\u044f<\/h2>\n<p>\u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0421\u0435\u0440\u0433\u0435\u0439 \u0428\u0430\u043c\u0431\u0438\u0440, \u0438 \u044f backend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 TravelLine (\u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e \u043d\u0430 C# \/ .NET).<\/p>\n<p>\u0422\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 4 \u0433\u043e\u0434\u0430 \u044f \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 backend-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0431\u044d\u043a-\u043e\u0444\u0438\u0441\u0430.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0435\u0441\u0442\u044c \u0434\u0432\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u043d\u044b\u0435 \u0447\u0435\u0440\u0442\u044b:<\/p>\n<ol>\n<li>\n<p>\u041c\u043d\u043e\u0433\u043e \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u041c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0439 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c\u0438 \u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 \u2014 \u043f\u0440\u0438\u0447\u0451\u043c \u0441\u043c\u0435\u0436\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0447\u0430\u0441\u0442\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445, \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0437\u043e\u043e\u043f\u0430\u0440\u043a \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f<\/p>\n<\/li>\n<\/ol>\n<blockquote>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u041c\u0430\u0440\u0442\u0438\u043d\u0430 \u0424\u0430\u0443\u043b\u0435\u0440\u0430 \u043d\u0430 \u0442\u0435\u043c\u0443 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0439: <a href=\"https:\/\/martinfowler.com\/articles\/cant-buy-integration.html\" rel=\"noopener noreferrer nofollow\">You Can&#8217;t Buy Integration<\/a>.<\/p>\n<\/blockquote>\n<p>\u042d\u0442\u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0435 \u0443\u0440\u043e\u0432\u043d\u0438 \u0442\u0435\u0441\u0442\u043e\u0432:<\/p>\n<ol>\n<li>\n<p>\u0412\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u0431\u043e\u0301\u043b\u044c\u0448\u0435\u0439 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0439 \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 API \u0432 \u043c\u043e\u0438\u0445 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u0430\u0445 \u043c\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432, \u0437\u0430\u043c\u0435\u043d\u044f\u044e\u0449\u0438\u0445 \u043d\u0435\u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0435 \u0432\u043d\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<li>\n<p>\u0422\u0430\u043a\u0436\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0443\u0431\u043b\u0451\u0440\u044b \u0432 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u0430\u0445, \u0437\u0430\u043c\u0435\u043d\u044f\u044f \u0432\u0441\u0435 Collaborator Objects \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 (\u0435\u0441\u043b\u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043e\u043d \u0441 \u043a\u0435\u043c-\u0442\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442)<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u0442\u0435\u0441\u0442\u0430\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435: \u044f \u0444\u043e\u043a\u0443\u0441\u0438\u0440\u0443\u044e\u0441\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u0451\u043c\u043e\u0447\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u0430\u0445. \u042d\u0442\u043e\u0442 \u0442\u0438\u043f \u0442\u0435\u0441\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043a\u0440\u0430\u0442\u043a\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<ol>\n<li>\n<p>\u041e\u043d\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u044f\u0437\u044b\u043a\u043e\u043c, \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u0430\u043c \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u044f\u0437\u044b\u043a Gherkin (\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <a href=\"https:\/\/reqnroll.net\" rel=\"noopener noreferrer nofollow\">Reqnroll<\/a>); \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0442\u0435\u0441\u0442\u044b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u044e\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0443 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435, \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u043c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443<\/p>\n<ul>\n<li>\n<p>\u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u044d\u0442\u043e <em>\u043f\u0440\u0438\u0451\u043c\u043e\u0447\u043d\u044b\u0435<\/em> \u0442\u0435\u0441\u0442\u044b (<em>\u0430\u043d\u0433\u043b.<\/em> Acceptance Tests, \u0438\u043b\u0438 Customer Tests \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 Extreme Programming)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u041e\u043d\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u044e\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043a\u0430\u043a \u0447\u0451\u0440\u043d\u044b\u0439 \u044f\u0449\u0438\u043a (Black Box), \u0442\u043e \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/p>\n<ul>\n<li>\n<p>\u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u044d\u0442\u043e <em>\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435<\/em> \u0442\u0435\u0441\u0442\u044b (<em>\u0430\u043d\u0433\u043b<\/em>. Functional Tests)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u041e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u0421\u0423\u0411\u0414 \u0432 docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u043d\u043e \u0437\u0430\u043c\u0435\u043d\u044f\u044e\u0442 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c\u0438 \u0434\u0443\u0431\u043b\u0451\u0440\u0430\u043c\u0438 \u0432\u0441\u0435 \u043d\u0435\u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0435 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 (\u0432\u043a\u043b\u044e\u0447\u0430\u044f API \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432)<\/p>\n<ul>\n<li>\n<p>\u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u044d\u0442\u043e <em>\u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435<\/em> \u0442\u0435\u0441\u0442\u044b \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c \u043a\u043d\u0438\u0433\u0438 \u00ab\u041f\u0440\u0438\u043d\u0446\u0438\u043f\u044b Unit-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\u00bb \u0412\u043b\u0430\u0434\u0438\u043c\u0438\u0440\u0430 \u0425\u043e\u0440\u0438\u043a\u043e\u0432\u0430<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e \u043c\u043e\u0434\u0435\u043b\u0438 <a href=\"https:\/\/testing.googleblog.com\/2010\/12\/test-sizes.html\" rel=\"noopener noreferrer nofollow\">Test Sizes \u043e\u0442 Google<\/a>, \u043e\u043d\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0442\u0435\u0441\u0442\u0430\u043c\u0438 <em>\u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430<\/em> (<em>\u0430\u043d\u0433\u043b.<\/em> Medium Size)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0441\u043b\u0443\u0436\u0430\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c, \u043e\u0434\u043d\u0430\u043a\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0432\u043a\u043b\u0430\u0434 \u0432 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u043a\u043e\u0434\u0435 \u0438 \u0432 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u043d\u043e\u0441\u044f\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u0451\u043c\u043e\u0447\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b.<\/p>\n<h2>\u041a\u0430\u043a \u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e<\/h2>\n<p>\u042f \u043f\u043e\u043b\u0430\u0433\u0430\u044e, \u0447\u0442\u043e \u0443 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043e\u043f\u044b\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f Mock-\u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432 \u0432\u0440\u0443\u0447\u043d\u0443\u044e.<\/p>\n<p>\u0410 \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u043e\u043f\u044b\u0442\u0430 \u043d\u0435\u0442, \u0442\u043e \u043f\u0440\u043e\u043b\u0438\u0441\u0442\u0430\u0439\u0442\u0435 \u0441\u0442\u0430\u0442\u044c\u044e \u0432\u043d\u0438\u0437 \u0434\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438 \u0438\u0437\u0443\u0447\u0438\u0442\u0435 \u0438\u0445, \u0430 \u043f\u043e\u0442\u043e\u043c \u0432\u0435\u0440\u043d\u0438\u0442\u0435\u0441\u044c \u0432 \u043d\u0430\u0447\u0430\u043b\u043e.<\/p>\n<h2>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0434\u0443\u0431\u043b\u0451\u0440<\/h2>\n<p>\u0422\u0435\u0440\u043c\u0438\u043d \u00ab\u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0434\u0443\u0431\u043b\u0451\u0440\u00bb (<em>\u0430\u043d\u0433\u043b<\/em>. Test Double) \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0442 \u043a\u0438\u043d\u0435\u043c\u0430\u0442\u043e\u0433\u0440\u0430\u0444\u0430:<\/p>\n<ul>\n<li>\n<p>\u0432 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0430\u043a\u0442\u0451\u0440\u043e\u0432 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 double<\/p>\n<\/li>\n<li>\n<p>\u043a\u0430\u0441\u043a\u0430\u0434\u0451\u0440\u043e\u0432, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 stunt double<\/p>\n<\/li>\n<\/ul>\n<h2>\u041f\u044f\u0442\u044c \u0442\u0438\u043f\u043e\u0432 \u043a\u0440\u0430\u0442\u043a\u043e<\/h2>\n<p>\u0414\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<ol>\n<li>\n<p><strong>Dummy<\/strong> \u2014 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0434\u0443\u0431\u043b\u0451\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u0438 \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<li>\n<p><strong>Stub<\/strong> \u2014 \u0434\u0443\u0431\u043b\u0451\u0440, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0434 \u043e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0432\u0432\u043e\u0434\u043e\u043c (indirect input) \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/p>\n<\/li>\n<li>\n<p><strong>Spy<\/strong> \u2014 \u0434\u0443\u0431\u043b\u0451\u0440, \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0432\u0435\u0441\u044c \u043e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 (indirect output) \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/p>\n<\/li>\n<li>\n<p><strong>Mock<\/strong> \u2014 \u0434\u0443\u0431\u043b\u0451\u0440, \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u043e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u0441 <em>\u0437\u0430\u0440\u0430\u043d\u0435\u0435<\/em> \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f\u043c\u0438<\/p>\n<\/li>\n<li>\n<p><strong>Fake<\/strong> \u2014 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0430\u044f \u0438 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u0430\u044f, \u043d\u043e \u0444\u0430\u043b\u044c\u0448\u0438\u0432\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430<\/p>\n<\/li>\n<\/ol>\n<blockquote>\n<p>\u0422\u0435\u0440\u043c\u0438\u043d\u044b \u00ab\u043e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u0432\u043e\u0434\u00bb \u0438 \u00ab\u043e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434\u00bb \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0434\u0430\u043b\u0435\u0435.<\/p>\n<\/blockquote>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432<\/h3>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p align=\"left\"><strong>\u0422\u0438\u043f \u0434\u0443\u0431\u043b\u0451\u0440\u0430<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"195\" width=\"195\">\n<p align=\"left\"><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043b\u0430\u0441\u0441\u0430<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p align=\"left\">Dummy<\/p>\n<\/td>\n<td data-colwidth=\"195\" width=\"195\">\n<p align=\"left\">DummyLogger<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 ILogger, \u043d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p align=\"left\">Stub<\/p>\n<\/td>\n<td data-colwidth=\"195\" width=\"195\">\n<p align=\"left\">StubCurrencyDataSource<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0432\u0430\u043b\u044e\u0442\u0430\u0445, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0439 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p align=\"left\">Spy<\/p>\n<\/td>\n<td data-colwidth=\"195\" width=\"195\">\n<p align=\"left\">SpyMailSender<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 IMailSender. \u041d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442, \u043d\u043e \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0438\u0441\u044c\u043c\u0430 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0442\u0435\u0441\u0442\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0438\u0445.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p align=\"left\">Mock<\/p>\n<\/td>\n<td data-colwidth=\"195\" width=\"195\">\n<p align=\"left\">MockMailSender<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 IMailSender. \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u0441\u0442\u043e\u043c \u043d\u0430 \u0448\u0430\u0433\u0435 Arrange (Given), \u0430 \u043d\u0430 \u0448\u0430\u0433\u0435 Act (When) \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u043f\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c \u0438 \u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c. <\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p align=\"left\">Fake<\/p>\n<\/td>\n<td data-colwidth=\"195\" width=\"195\">\n<p align=\"left\">FakeUserRepository<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 IUserRepository. \u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043d\u0435\u043e\u0442\u043b\u0438\u0447\u0438\u043c \u043e\u0442 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f. \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u0444\u0430\u043b\u044c\u0448\u0438\u0432\u043a\u0430: \u043e\u043d \u0445\u0440\u0430\u043d\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435 \u0432 \u0411\u0414, \u0430 \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<blockquote>\n<p>\u0420\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0448\u0430\u0433\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \u2014 Arrange, Act, Assert (\u043e\u043d\u0438 \u0436\u0435 Given, When, Then \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 BDD) \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0434\u0430\u043b\u0435\u0435.<\/p>\n<\/blockquote>\n<h2>\u0410\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c\u0438 \u0434\u0443\u0431\u043b\u0451\u0440\u0430\u043c\u0438<\/h2>\n<h3>1. \u041c\u043e\u0434\u0435\u043b\u044c \u043e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430\/\u0432\u044b\u0432\u043e\u0434\u0430<\/h3>\n<p>\u042d\u0442\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u0438\u043f \u0434\u0443\u0431\u043b\u0451\u0440\u0430, \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438.<\/p>\n<p>\u041e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u0432\u043e\u0434 \/ \u0432\u044b\u0432\u043e\u0434 (<em>\u0430\u043d\u0433\u043b<\/em>. indirect input \/ output) \u2014 \u044d\u0442\u043e \u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 (SUT) \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 (Collaborators):<\/p>\n<ul>\n<li>\n<p>\u041e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u0432\u043e\u0434 \u2014 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0447\u0438\u0442\u0430\u0435\u0442 \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \/ \u0441\u0438\u0441\u0442\u0435\u043c<\/p>\n<\/li>\n<li>\n<p>\u041e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u2014 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u0438\u0448\u0435\u0442 \u0432 \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \/ \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1c7\/bfa\/23c\/1c7bfa23ccbc5360addc171a62883bde.png\" width=\"553\" height=\"115\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1c7\/bfa\/23c\/1c7bfa23ccbc5360addc171a62883bde.png\"\/><\/figure>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \/ \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0431\u044b\u0432\u0430\u0435\u0442 \u0442\u0440\u0451\u0445 \u0442\u0438\u043f\u043e\u0432:<\/p>\n<ol>\n<li>\n<p>\u0422\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \/ \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u2014 \u043e\u0434\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u0442.\u0435. \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u0432\u043e\u0434<\/p>\n<\/li>\n<li>\n<p>\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \/ \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u2014 \u043e\u0434\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u0442.\u0435. \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434<\/p>\n<\/li>\n<li>\n<p>\u0427\u0442\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u2014 \u0434\u0432\u0443\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435<\/p>\n<\/li>\n<\/ol>\n<h4>\u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b<\/h4>\n<p>\u0420\u0430\u0441\u043a\u0438\u0434\u0430\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0432\u044b\u0448\u0435 \u043f\u043e \u0442\u0438\u043f\u0443 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u043c:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"195\" width=\"195\">\n<p align=\"left\"><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043b\u0430\u0441\u0441\u0430<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>\u0421\u043f\u043e\u0441\u043e\u0431 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u043c<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>\u0427\u0442\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0434\u0443\u0431\u043b\u0451\u0440<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"195\" width=\"195\">\n<p align=\"left\">DummyLogger<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0417\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041d\u0438\u043a\u0443\u0434\u0430 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u0438\u0448\u0435\u0442<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"195\" width=\"195\">\n<p align=\"left\">StubCurrencyDataSource<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0427\u0442\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"195\" width=\"195\">\n<p align=\"left\">SpyMailSender<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0417\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0417\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, \u0447\u0442\u043e\u0431\u044b \u0442\u0435\u0441\u0442 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b \u0438\u0445<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"195\" width=\"195\">\n<p align=\"left\">MockMailSender<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0417\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 \u0432\u044b\u0437\u043e\u0432\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f\u043c\u0438<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"195\" width=\"195\">\n<p align=\"left\">FakeUserRepository<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0414\u0432\u0443\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435 (\u0447\u0442\u0435\u043d\u0438\u0435\/\u0437\u0430\u043f\u0438\u0441\u044c)<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0425\u0440\u0430\u043d\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h4>\u041e\u0431\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430<\/h4>\n<p>\u041c\u043e\u0436\u0435\u043c \u043e\u0431\u043e\u0431\u0449\u0438\u0442\u044c, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044f \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043a \u043e\u0431\u0449\u0438\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"101\" width=\"101\">\n<p align=\"left\"><strong>\u0422\u0438\u043f \u0434\u0443\u0431\u043b\u0451\u0440\u0430<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"414\" width=\"414\">\n<p align=\"left\"><strong>\u0421\u043f\u043e\u0441\u043e\u0431 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u043c<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"101\" width=\"101\">\n<p align=\"left\">Dummy<\/p>\n<\/td>\n<td data-colwidth=\"414\" width=\"414\">\n<p align=\"left\">\u043b\u044e\u0431\u043e\u0439, \u043e\u0431\u044b\u0447\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"101\" width=\"101\">\n<p align=\"left\">Stub<\/p>\n<\/td>\n<td data-colwidth=\"414\" width=\"414\">\n<p align=\"left\">\u0447\u0442\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"101\" width=\"101\">\n<p align=\"left\">Spy<\/p>\n<\/td>\n<td data-colwidth=\"414\" width=\"414\">\n<p align=\"left\">\u0437\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043b\u0438\u0431\u043e \u0434\u0432\u0443\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435 (Spy+Stub)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"101\" width=\"101\">\n<p align=\"left\">Mock<\/p>\n<\/td>\n<td data-colwidth=\"414\" width=\"414\">\n<p align=\"left\">\u0437\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043b\u0438\u0431\u043e \u0434\u0432\u0443\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435 (Mock+Stub)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"101\" width=\"101\">\n<p align=\"left\">Fake<\/p>\n<\/td>\n<td data-colwidth=\"414\" width=\"414\">\n<p align=\"left\">\u043b\u044e\u0431\u043e\u0439, \u043e\u0431\u044b\u0447\u043d\u043e \u0434\u0432\u0443\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h4>Spy+Stub \u0438 Mock+Stub<\/h4>\n<p>\u0414\u0443\u0431\u043b\u0451\u0440\u044b \u0442\u0438\u043f\u043e\u0432 Spy \u0438 Mock \u043c\u043e\u0433\u0443\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442\u044c \u0442\u0438\u043f\u0443 Stub, \u0442\u043e \u0435\u0441\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0434\u0443\u0431\u043b\u0451\u0440 \u0441\u043e\u0447\u0435\u0442\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 Spy \u0438 Stub, \u0442\u043e \u043e\u043d \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0432\u0435\u0441\u044c \u0432\u044b\u0432\u043e\u0434 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u0432\u0432\u043e\u0434<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0434\u0443\u0431\u043b\u0451\u0440 \u0441\u043e\u0447\u0435\u0442\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 Mock \u0438 Stub, \u0442\u043e \u043e\u043d \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f\u043c\u0438 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432 \u043e\u0442\u0432\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 Mock<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u043c\u0435\u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432 \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0441\u043b\u043e\u0432\u043e Spy \u0438\u043b\u0438 Mock, \u043d\u043e \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0441\u043b\u043e\u0432\u0430 Stub.<\/p>\n<h3>2. \u041c\u043e\u0434\u0435\u043b\u044c Arrange-Act-Assert<\/h3>\n<p>\u0420\u0430\u0437\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0448\u0430\u0433\u0430\u0445 \u0442\u0435\u0441\u0442\u0430.<\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0435 \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u043f\u043e \u043c\u043e\u0434\u0435\u043b\u0438 AAA: Arrange, Act, Assert<\/p>\n<ol>\n<li>\n<p>\u041d\u0430 \u0448\u0430\u0433\u0435 <strong>Arrange<\/strong> \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 (\u043c\u0435\u0442\u043e\u0434\u043e\u0432)<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430 \u0448\u0430\u0433\u0435 <strong>Act<\/strong> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u044b\u0437\u043e\u0432 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f (\u043c\u0435\u0442\u043e\u0434\u0430)<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430 \u0448\u0430\u0433\u0435 <strong>Assert<\/strong> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432<\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0430\u0432\u0442\u043e\u0440\u044b \u0432\u044b\u0434\u0435\u043b\u044f\u044e\u0442 \u0447\u0435\u0442\u0432\u0451\u0440\u0442\u044b\u0439 \u0448\u0430\u0433 \u2014 <strong>Cleanup<\/strong> \u0438\u043b\u0438 <strong>Teardown<\/strong> \u2014 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0439 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0438 \u043e\u0442\u043a\u0430\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0445 \u043f\u043e\u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u0442\u0435\u0441\u0442\u044b.<\/p>\n<h4>\u041c\u0438\u043d\u0443\u0442\u043a\u0430 BDD<\/h4>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 Behavior Driven Development, \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043c\u0435\u043d\u0430 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0439: \u0432\u043c\u0435\u0441\u0442\u043e Arrange \/ Act \/ Assert \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0433\u043b\u0430\u0433\u043e\u043b\u044b Given \/ When \/ Then.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430-\u0442\u043e \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u044f \u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u0441\u043c\u0435\u043d\u0430 \u0433\u043b\u0430\u0433\u043e\u043b\u043e\u0432 \u2014 \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0441\u0443\u0442\u044c BDD (<em>\u0445\u0430-\u0445\u0430<\/em>!). \u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u044f \u0441\u0447\u0438\u0442\u0430\u043b BDD \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u043e\u0439.<\/p>\n<p>\u0421\u0443\u0442\u044c BDD \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043d\u0435 \u0432 \u0433\u043b\u0430\u0433\u043e\u043b\u0430\u0445, \u0430 \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043f\u0440\u0438\u0451\u043c\u043e\u0447\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 (\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432) \u043d\u0430 \u044f\u0437\u044b\u043a\u0435, \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u043c \u0432\u0441\u0435\u043c \u0447\u043b\u0435\u043d\u0430\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u2014 product owner, \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430\u043c, \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430\u043c, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c<\/p>\n<ul>\n<li>\n<p>\u0415\u0441\u043b\u0438 BDD \u0441\u043e\u0447\u0435\u0442\u0430\u0435\u0442\u0441\u044f \u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0447\u0435\u0440\u0435\u0437 User Story (\u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c Acceptance Criteria \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0418\u0441\u0442\u043e\u0440\u0438\u0438), \u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 \u043f\u043e\u0437\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442 \u0434\u043b\u044f \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0439 \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043a\u0430\u043a \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043c\u0435\u0436\u0434\u0443 \u0441\u043c\u0435\u0436\u043d\u044b\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 \u0438 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043b\u044f\u043c\u0438 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 BDD \u0441\u043e\u0447\u0435\u0442\u0430\u0435\u0442\u0441\u044f \u0441 \u044f\u0437\u044b\u043a\u043e\u043c Gherkin, \u0442\u043e \u0442\u0435\u0441\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u043c\u0438 \u0438 \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u044b\u043c\u0438 \u043a \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0443<\/p>\n<\/li>\n<\/ul>\n<p>\u041e \u0442\u0435\u0441\u0442\u0430\u0445 \u043d\u0430 Gherkin \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/habr.com\/ru\/articles\/860932\/\" rel=\"noopener noreferrer nofollow\">\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0434\u043b\u044f ASP.NET Core<\/a>, \u0430 \u043d\u0438\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430:<\/p>\n<pre><code class=\"yaml\">\u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439: \u041c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u0434\u0438\u043d     \u041f\u0443\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b:       | \u041a\u043e\u0434    | \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435                   | \u0426\u0435\u043d\u0430  | \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e |       | A12345 | \u0427\u0442\u043e-\u0442\u043e \u0438\u0437 \u043b\u044c\u043d\u044f\u043d\u043e\u0433\u043e \u0432\u043e\u043b\u043e\u043a\u043d\u0430 | 49,90 | 300        |       | B99999 | \u0416\u0435\u043d\u0441\u043a\u0438\u0439 \u043e\u0431\u043e\u0434\u043e\u043a \u0434\u043b\u044f \u0432\u043e\u043b\u043e\u0441   | 99,00 | 12         |      \u041a\u043e\u0433\u0434\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b:       | \u041a\u043e\u0434    | \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435                    | \u0426\u0435\u043d\u0430  | \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e |       | A12345 | \u0424\u0443\u0444\u0430\u0439\u043a\u0430 \u0438\u0437 \u043b\u044c\u043d\u044f\u043d\u043e\u0433\u043e \u0432\u043e\u043b\u043e\u043a\u043d\u0430 | 49,90 | 400        |      \u0422\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432:       | \u041a\u043e\u0434    | \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435                    | \u0426\u0435\u043d\u0430  | \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e |       | A12345 | \u0424\u0443\u0444\u0430\u0439\u043a\u0430 \u0438\u0437 \u043b\u044c\u043d\u044f\u043d\u043e\u0433\u043e \u0432\u043e\u043b\u043e\u043a\u043d\u0430 | 49,90 | 400        |       | B99999 | \u0416\u0435\u043d\u0441\u043a\u0438\u0439 \u043e\u0431\u043e\u0434\u043e\u043a \u0434\u043b\u044f \u0432\u043e\u043b\u043e\u0441    | 99,00 | 12         |<\/code><\/pre>\n<h4>\u0422\u0438\u043f\u044b \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432 \u0438 \u0448\u0430\u0433\u0438 AAA<\/h4>\n<p>\u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u043d\u0430\u0448\u0438\u043c \u0434\u0443\u0431\u043b\u0451\u0440\u0430\u043c \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0445 \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u044c \u0441 \u0448\u0430\u0433\u0430\u043c\u0438 AAA.<\/p>\n<p>\u0412\u0441\u0435 \u0442\u0438\u043f\u044b \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432 \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u0432\u043d\u0435\u0434\u0440\u044f\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u2014\u00a0\u0447\u0435\u0440\u0435\u0437 DI-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043b\u0438\u0431\u043e \u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u0432\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u0434\u0443\u0431\u043b\u0451\u0440\u0430 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0448\u0430\u0433\u0430\u043c\u0438 \u0442\u0435\u0441\u0442\u0430.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"199\" width=\"199\">\n<p align=\"left\"><strong>\u0422\u0438\u043f \u0434\u0443\u0431\u043b\u0451\u0440\u0430<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>\u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0448\u0430\u0433\u0438 AAA<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"199\" width=\"199\">\n<p align=\"left\">Dummy<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2014<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"199\" width=\"199\">\n<p align=\"left\">Stub<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041d\u0430 \u0448\u0430\u0433\u0435 Arrange \u0432 Stub \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"199\" width=\"199\">\n<p align=\"left\">Spy<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041d\u0430 \u0448\u0430\u0433\u0435 Assert \u0438\u0437 Spy \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"199\" width=\"199\">\n<p align=\"left\">Mock<\/p>\n<\/td>\n<td>\n<p align=\"left\">Mock \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0448\u0430\u0433\u0435 Arrange (\u043b\u0438\u0431\u043e \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 Setup), \u0438 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430 \u0448\u0430\u0433\u0435 Act.<\/p>\n<p align=\"left\">\u0418\u043d\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043e\u0442\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u043e \u0448\u0430\u0433\u0430 Assert (\u0435\u0441\u043b\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u044f\u0432\u043d\u043e).<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"199\" width=\"199\">\n<p align=\"left\">Fake<\/p>\n<\/td>\n<td>\n<p align=\"left\">Fake \u0434\u043e\u043b\u0436\u0435\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u0431\u0435\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432 \u0442\u0435\u0441\u0442\u0435.<\/p>\n<p align=\"left\">\u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0442\u0435\u0441\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 Fake, \u0438\u0437\u043c\u0435\u043d\u044f\u044f \u0435\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043d\u0430 \u0448\u0430\u0433\u0435 Arrange \u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044f \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043d\u0430 \u0448\u0430\u0433\u0435 Assert.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432 \u043d\u0430 C#<\/h2>\n<p>\u041e\u0431\u0449\u0438\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0441\u0435\u0445 \u0442\u0438\u043f\u043e\u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>\u0412\u0441\u0435 \u0442\u0438\u043f\u044b \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043a\u043e\u0434 \u0432\u0441\u0435 \u0442\u0438\u043f\u044b \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432 \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u0432\u043d\u0435\u0434\u0440\u044f\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u2014\u00a0\u0447\u0435\u0440\u0435\u0437 DI-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043b\u0438\u0431\u043e \u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432 \u0432 production \u2014\u00a0\u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043f\u0430\u043a\u0435\u0442, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u044b\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u0435\u0441\u0442\u0430\u0445, \u0438\u043b\u0438 \u0438\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435\/\u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0432 production<\/p>\n<\/li>\n<\/ul>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 Dummy<\/h3>\n<p>Dummy-\u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Null Object \u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043b\u0430\u0441\u0441 DummyLogger<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">\/\/\/ &lt;summary&gt; \/\/\/ \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 ILogger, \u043d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442. \/\/\/ &lt;\/summary&gt; public class DummyLogger : ILogger {     public void Log(Level level, string message, params object[] arguments)     {         \/\/ \u0423\u043b\u044b\u0431\u0430\u0435\u043c\u0441\u044f \u0438 \u043c\u0430\u0448\u0435\u043c.     } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 Stub<\/h3>\n<p>Stub-\u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043b\u0438\u0431\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0442 \u0438\u0445 \u0441 \u0434\u0438\u0441\u043a\u0430.<\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, Stub-\u043e\u0431\u044a\u0435\u043a\u0442 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0448\u0430\u0433\u0435 Arrange (Given) \u0442\u0435\u0441\u0442\u0430.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043b\u0430\u0441\u0441 StubCurrencyDataSource<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">\/\/\/ &lt;summary&gt; \/\/\/ \u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0432\u0430\u043b\u044e\u0442\u0430\u0445, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0439 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \/\/\/ &lt;\/summary&gt; public class StubCurrencyDataSource: ICurrencyDataSource {     private readonly List&lt;CurrencyData&gt; _currencies = [         new CurrencyData(\"\u0420\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u0438\u0439 \u0440\u0443\u0431\u043b\u044c\", \"RUB\"),         new CurrencyData(\"\u041a\u0438\u0442\u0430\u0439\u0441\u043a\u0438\u0439 \u044e\u0430\u043d\u044c\", \"CNY\"),         new CurrencyData(\"\u0411\u0440\u0430\u0437\u0438\u043b\u044c\u0441\u043a\u0438\u0439 \u0440\u0435\u0430\u043b\", \"BRL\"),         new CurrencyData(\"\u0418\u043d\u0434\u0438\u0439\u0441\u043a\u0430\u044f \u0440\u0443\u043f\u0438\u044f\", \"INR\"),         new CurrencyData(\"\u042e\u0436\u043d\u043e\u0430\u0444\u0440\u0438\u043a\u0430\u043d\u0441\u043a\u0438\u0439 \u0440\u044d\u043d\u0434\", \"ZAR\"),     ];      public IEnumerable&lt;string&gt; GetSupportedCurrencyCodes()     {         return _currencies.Select(data =&gt; data.Code());     }      public string GetNameByCode(string code)     {         return _currencies.First(data =&gt; data.Code == code).Name;     }      private record CurrencyData(         string Name,         string Code     ); }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h3>Mock-\u043e\u0431\u044a\u0435\u043a\u0442\u044b<\/h3>\n<p>Mock \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e DSL (Domain Specific Language), \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0442\u0430\u043a\u043e\u0433\u043e DSL \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u043c \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 Mock \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0441\u043c. <a href=\"https:\/\/github.com\/devlooped\/moq\/wiki\/Quickstart\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 Quickstart \u0432 wiki \u043f\u0430\u043a\u0435\u0442\u0430 Moq<\/a>.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440\u044b Spy<\/h3>\n<p>Spy-\u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0441\u0445\u043e\u0436\u0438 \u043d\u0430 Mock \u043f\u043e \u0441\u0432\u043e\u0435\u043c\u0443 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e, \u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<ul>\n<li>\n<p>Mock \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043d\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u043e\u043c \u043a\u043e\u0434\u0435, \u0430 \u0442\u0435\u0441\u0442 \u043b\u0438\u0448\u044c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u0435\u0433\u043e \u043d\u0430 \u0448\u0430\u0433\u0435 Arrange (Given) \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u0441 \u043a\u0430\u043a\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0437\u0432\u0430\u043d\u044b, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e Mock-\u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u0432\u0435\u0440\u044f\u0435\u0442 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0438 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0432\u044b\u0437\u043e\u0432\u044b\/\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043b\u0438\u0431\u043e \u0441\u0440\u0430\u0437\u0443 \u043d\u0430 \u0448\u0430\u0433\u0435 Act (When), \u043b\u0438\u0431\u043e \u043f\u043e\u0437\u0436\u0435 \u043d\u0430 \u0448\u0430\u0433\u0435 Assert (Then) <\/p>\n<\/li>\n<li>\n<p>Spy \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043d\u0430 \u0448\u0430\u0433\u0435 Act (When), \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u0442\u0435\u0441\u0442\u0443 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0438\u0445 \u043d\u0430 \u0448\u0430\u0433\u0435 Assert (Then)<\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f Spy \u043c\u043e\u0436\u0435\u0442 \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0443 \u043b\u0438\u0431\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c, \u043d\u043e \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043b\u0430\u0441\u0441 SpyMailSender<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">\/\/\/ &lt;summary&gt; \/\/\/ \u041d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442, \u043d\u043e \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0438\u0441\u044c\u043c\u0430 \/\/\/  \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0442\u0435\u0441\u0442\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0438\u0445. \/\/\/ &lt;\/summary&gt; public class SpyMailSender : IMailSender {     private readonly List&lt;MimeMessage&gt; _sentMails = [];      public Task SendAsync(MimeMessage mail)     {         _sentMails.Add(x);         return Task.CompletedTask; \/\/ \u0423\u0441\u0451 \u0433\u043e\u0442\u043e\u0432\u043e, \u0448\u0435\u0444!     }      public MimeMessage FindMailByToName(string toName)     {         return _sentMails.Single(             message =&gt; message.To.Any(x =&gt; x.Name == toName)         );     } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 Fake<\/h3>\n<p>Fake-\u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 (\u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442\u044c \u0442\u0435\u0441\u0442\u0443 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435).<\/p>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0439 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u0443\u0434\u0430\u0447\u043d\u043e\u0433\u043e Fake: \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043e\u043d \u043d\u0435\u043e\u0442\u043b\u0438\u0447\u0438\u043c \u043e\u0442 \u043f\u043e\u0434\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043d\u043e \u0443\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0439 \u0430\u0441\u043f\u0435\u043a\u0442 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u2014 \u0432 \u043d\u0451\u043c \u043d\u0435\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0432\u043d\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043d\u044b\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043b\u0430\u0441\u0441 FakeUserRepository<\/summary>\n<div class=\"spoiler__content\">\n<p>Fake-\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u0442\u0440\u043e\u044f\u0442\u0441\u044f \u043d\u0430 \u0434\u0432\u0443\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0445:<\/p>\n<ul>\n<li>\n<p>\u0421\u043b\u043e\u0432\u0430\u0440\u0438 (\u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b) \u0432\u043c\u0435\u0441\u0442\u043e \u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0446, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043a\u043b\u044e\u0447 \u0441\u043b\u043e\u0432\u0430\u0440\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u043c\u0443 \u043a\u043b\u044e\u0447\u0443 \u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0430 \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0434\u0440\u0443\u0433\u0438\u043c \u043a\u043b\u044e\u0447\u0430\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043b\u0438\u043d\u0435\u0439\u043d\u043e (\u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u0442\u0435\u0441\u0442\u0435 \u043c\u0430\u043b\u043e \u0434\u0430\u043d\u043d\u044b\u0445)<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0441\u0442\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f ID \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0443\u0442\u0451\u043c \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438\u043b\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 UUID \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cs\">\/\/\/ &lt;summary&gt; \/\/\/ \u0424\u0430\u043b\u044c\u0448\u0438\u0432\u043a\u0430: \u043d\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043f\u0435\u0440\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u0438. \/\/\/ \u0425\u0440\u0430\u043d\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0411\u0414. \/\/\/ &lt;\/summary&gt; public class FakeUserRepository : IUserRepository {     private Dictionary&lt;string, User&gt; _users = new();      public User? Find(string id)     {         return _users.GetOrDefault(id);     }      public List&lt;User&gt; FindAllByJobTitle(string jobTitle)     {         return _users.Values             .Where(u =&gt; u.JobTitle == jobTitle)             .ToList();     }      public void Add(User user)     {         _users[user.Id] = user;     }      public void Update(User user)     {         _users[user.Id] = user;     }      public void Delete(User user)     {         _users.Remove(user.Id);     } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h4>\u0414\u043e\u0432\u043e\u0434\u044b \u0432 \u043f\u043e\u043b\u044c\u0437\u0443 Fake-\u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432<\/h4>\n<p>\u041f\u043e \u043c\u043e\u0435\u043c\u0443 \u043b\u0438\u0447\u043d\u043e\u043c\u0443 \u043e\u043f\u044b\u0442\u0443, Fake \u0447\u0430\u0441\u0442\u043e \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0441\u044f \u0432\u044b\u0433\u043e\u0434\u043d\u0435\u0435, \u0447\u0435\u043c \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044f Mock \u0438 Stub \u0438\u043b\u0438 Spy \u0438 Stub:<\/p>\n<ol>\n<li>\n<p>\u041d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Fake-\u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u0435\u043b\u0430\u0435\u0442 \u0442\u0435\u0441\u0442\u044b \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u0435\u0435 \u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043d\u0435 \u043c\u0435\u043d\u044f\u044e\u0449\u0438\u043c \u0435\u0451 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 (\u0431\u0443\u0434\u044c \u0442\u043e \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433 \u0438\u043b\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f)<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f Fake-\u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0434\u0430\u0451\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0443 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043b\u0443\u0447\u0448\u0435\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043f\u043e\u0434\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438\u043b\u0438 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/p>\n<\/li>\n<li>\n<p>\u0413\u043e\u0442\u043e\u0432\u044b\u0439 Fake \u043f\u043e\u043d\u0438\u0436\u0430\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u043e\u0432, \u0447\u0442\u043e \u043c\u043e\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043b\u043b\u0435\u0433 \u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0442\u044c \u0440\u0430\u043d\u0435\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b<\/p>\n<\/li>\n<li>\n<p>\u0421 \u0445\u043e\u0440\u043e\u0448\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c Fake-\u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0442\u0435\u0441\u0442 \u0438\u043c\u0435\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0448\u0430\u043d\u0441\u043e\u0432 \u043d\u0430\u0439\u0442\u0438 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0442\u043e\u0447\u043d\u0435\u0435 \u0438\u043c\u0438\u0442\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 Fake \u2014 \u043c\u043e\u0439 \u043b\u044e\u0431\u0438\u043c\u044b\u0439 \u0442\u0438\u043f \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0434\u0443\u0431\u043b\u0451\u0440\u0430.<\/p>\n<h2>\u042d\u0442\u0438\u043c\u043e\u043b\u043e\u0433\u0438\u044f \u0441\u043b\u043e\u0432<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u043b\u0443\u0447\u0448\u0435 \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u043c\u0435\u0436\u0434\u0443 \u0442\u0438\u043f\u0430\u043c\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432, \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043d\u044e\u0430\u043d\u0441\u0430\u043c\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0445 \u0441\u043b\u043e\u0432:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"133\" width=\"133\">\n<p align=\"left\"><strong>\u0421\u043b\u043e\u0432\u043e<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0432\u0430<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"133\" width=\"133\">\n<p align=\"left\">Dummy<\/p>\n<\/td>\n<td>\n<p align=\"left\">1) \u0414\u0435\u0442\u0441\u043a\u0430\u044f \u043f\u0443\u0441\u0442\u044b\u0448\u043a\u0430;<\/p>\n<p align=\"left\">2) \u0413\u0440\u0443\u0431\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u043a\u0435\u0442 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443\u0447\u0435\u0431\u043d\u0430\u044f \u043c\u0438\u0448\u0435\u043d\u044c \u0438\u0437 \u0434\u0435\u0440\u0435\u0432\u0430<\/p>\n<p align=\"left\">3) \u041c\u0430\u043d\u0435\u043a\u0435\u043d, \u043c\u0443\u043b\u044f\u0436<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"133\" width=\"133\">\n<p align=\"left\">Stub<\/p>\n<\/td>\n<td>\n<p align=\"left\">1) \u041e\u0441\u0442\u0430\u0442\u043e\u043a (\u0441\u0442\u0435\u043d\u044b);<\/p>\n<p align=\"left\">2) \u041a\u043e\u0440\u0435\u0448\u043e\u043a (\u0432 \u043e\u0442\u0440\u044b\u0432\u043d\u043e\u0439 \u0447\u0435\u043a\u043e\u0432\u043e\u0439 \u043a\u043d\u0438\u0436\u043a\u0435)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"133\" width=\"133\">\n<p align=\"left\">Spy<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0422\u0430\u0439\u043d\u044b\u0439 \u0430\u0433\u0435\u043d\u0442, \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0449\u0438\u0439 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"133\" width=\"133\">\n<p align=\"left\">Mock<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0418\u043c\u0438\u0442\u0430\u0446\u0438\u044f, \u043c\u0438\u043c\u0438\u043a\u0440\u0438\u0440\u0443\u044e\u0449\u0430\u044f \u043f\u043e\u0434 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"133\" width=\"133\">\n<p align=\"left\">Fake<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0424\u0430\u043b\u044c\u0448\u0438\u0432\u0430\u044f \u043a\u043e\u043f\u0438\u044f \u2014 \u043f\u043e\u0434\u0434\u0435\u043b\u043a\u0430 \u043f\u043e\u0434 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0439<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0414\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043c\u0435\u0436\u0434\u0443 Mock \u0438 Fake \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0434\u0432\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>Mock exam \u2014 \u0440\u0435\u043f\u0435\u0442\u0438\u0446\u0438\u044f \u044d\u043a\u0437\u0430\u043c\u0435\u043d\u0430, \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0451\u043d\u043d\u0430\u044f \u043a \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 \u044d\u043a\u0437\u0430\u043c\u0435\u043d\u0443<\/p>\n<\/li>\n<li>\n<p>Fake exam \u2014 \u043f\u043e\u0434\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u044d\u043a\u0437\u0430\u043c\u0435\u043d, \u0440\u0430\u0437\u043d\u043e\u0432\u0438\u0434\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0448\u0435\u043d\u043d\u0438\u0447\u0435\u0441\u0442\u0432\u0430<\/p>\n<\/li>\n<\/ul>\n<h2>\u041f\u043e\u0434\u044b\u0442\u043e\u0436\u0438\u043c<\/h2>\n<p>\u041c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438 \u043f\u044f\u0442\u044c \u0442\u0438\u043f\u043e\u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432:<\/p>\n<ol>\n<li>\n<p><strong>Dummy<\/strong> \u2014 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0434\u0443\u0431\u043b\u0451\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u0438 \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<li>\n<p><strong>Stub<\/strong> \u2014 \u0434\u0443\u0431\u043b\u0451\u0440, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0434 \u043e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0432\u0432\u043e\u0434\u043e\u043c (indirect input) \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/p>\n<\/li>\n<li>\n<p><strong>Spy<\/strong> \u2014 \u0434\u0443\u0431\u043b\u0451\u0440, \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0432\u0435\u0441\u044c \u043e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 (indirect output) \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/p>\n<\/li>\n<li>\n<p><strong>Mock<\/strong> \u2014 \u0434\u0443\u0431\u043b\u0451\u0440, \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u043e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u0441 <em>\u0437\u0430\u0440\u0430\u043d\u0435\u0435<\/em> \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f\u043c\u0438<\/p>\n<\/li>\n<li>\n<p><strong>Fake<\/strong> \u2014 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0430\u044f \u0438 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u0430\u044f, \u043d\u043e \u0444\u0430\u043b\u044c\u0448\u0438\u0432\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430<\/p>\n<\/li>\n<\/ol>\n<p>\u0415\u0441\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u044b \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435:<\/p>\n<ol>\n<li>\n<p>\u041a\u0430\u043a \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0443\u0431\u043b\u0451\u0440\u044b \u0434\u043b\u044f <em>\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0445<\/em> \u0442\u0435\u0441\u0442\u043e\u0432?<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0443\u0431\u043b\u0451\u0440\u044b \u0434\u043b\u044f <em>\u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445<\/em> \u0442\u0435\u0441\u0442\u043e\u0432?<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b?<\/p>\n<\/li>\n<\/ol>\n<p>\u0412\u043e\u043f\u0440\u043e\u0441\u044b \u21161 \u0438 \u21163 \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u044b \u0432 \u043a\u043d\u0438\u0433\u0435 \u00ab\u041f\u0440\u0438\u043d\u0446\u0438\u043f\u044b Unit-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\u00bb \u0412\u043b\u0430\u0434\u0438\u043c\u0438\u0440\u0430 \u0425\u043e\u0440\u0438\u043a\u043e\u0432\u0430.<\/p>\n<p>\u0412\u043e\u043f\u0440\u043e\u0441 \u21162 \u044f \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u044c \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u0435\u0435 \u0432 \u0441\u0432\u043e\u0438\u0445 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><\/p>\n<div class=\"tm-article-poll-container\"><!--[--><\/p>\n<div class=\"tm-article-poll tm-article-poll_variant-bordered\">\n<div class=\"tm-notice tm-notice_positive tm-article-poll__notice\"><!----><\/p>\n<div class=\"tm-notice__inner\"><!----><\/p>\n<div class=\"tm-notice__content\" data-test-id=\"notice-content\"><!--[--><span>\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a rel=\"nofollow\" href=\"\/kek\/v1\/auth\/habrahabr\/?back=\/ru\/articles\/871916\/&#038;hl=ru\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/span><!--]--><\/div>\n<\/div>\n<\/div>\n<p><!--[--><\/p>\n<div class=\"tm-article-poll__header\">\u041a\u0430\u043a\u0438\u0435 \u0442\u0438\u043f\u044b Test Doubles \u0432\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u043b\u0438 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445?<\/div>\n<div class=\"tm-article-poll__answers\"><!--[--><\/p>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">50% <\/span><span class=\"tm-article-poll__answer-label\">Dummy<\/span><span class=\"tm-article-poll__answer-votes\">4<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 50%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">50% <\/span><span class=\"tm-article-poll__answer-label\">Stub<\/span><span class=\"tm-article-poll__answer-votes\">4<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 50%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">12.5% <\/span><span class=\"tm-article-poll__answer-label\">Spy<\/span><span class=\"tm-article-poll__answer-votes\">1<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 12.5%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent tm-article-poll__answer-percent_winning\">62.5% <\/span><span class=\"tm-article-poll__answer-label\">Mock<\/span><span class=\"tm-article-poll__answer-votes\">5<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress tm-article-poll__answer-progress_winning\" style=\"width: 62.5%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">25% <\/span><span class=\"tm-article-poll__answer-label\">Fake<\/span><span class=\"tm-article-poll__answer-votes\">2<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 25%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">25% <\/span><span class=\"tm-article-poll__answer-label\">\u042f \u043d\u0435 \u043f\u0438\u0448\u0443 \u0442\u0435\u0441\u0442\u044b<\/span><span class=\"tm-article-poll__answer-votes\">2<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 25%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">25% <\/span><span class=\"tm-article-poll__answer-label\">\u0412 \u043c\u043e\u0438\u0445 \u0442\u0435\u0441\u0442\u0430\u0445 \u0432\u0441\u0451 \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435<\/span><span class=\"tm-article-poll__answer-votes\">2<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 25%\"><\/div>\n<\/div>\n<\/div>\n<p><!--]--><\/div>\n<div class=\"tm-article-poll__stats\"> \u041f\u0440\u043e\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b\u0438 8 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.   \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u043b\u0441\u044f 1 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c. <\/div>\n<p><!--]--><\/div>\n<p><!--]--><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/871916\/\"> https:\/\/habr.com\/ru\/articles\/871916\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0443\u0431\u043b\u0451\u0440\u044b (<em>\u0430\u043d\u0433\u043b<\/em>. Test Doubles) \u2014 \u044d\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0438\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u0430\u0445 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u043c\u0435\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b (<em>\u0430\u043d\u0433\u043b. SUT, System Under Test<\/em>).<\/p>\n<ul>\n<li>\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0432\u0441\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0443\u0431\u043b\u0451\u0440\u044b \u043e\u0434\u043d\u0438\u043c \u0441\u043b\u043e\u0432\u043e\u043c: Mock.<\/p>\n<\/li>\n<li>\n<p>\u0414\u0440\u0443\u0433\u0438\u0435 \u0432\u044b\u0434\u0435\u043b\u044f\u044e\u0442 \u0440\u043e\u0432\u043d\u043e \u0434\u0432\u0430 \u0442\u0438\u043f\u0430: Stub \u0438 Mock \u2014 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u043e\u043d\u0438 \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u0442\u0430\u0442\u044c\u0451\u0439 <a href=\"https:\/\/martinfowler.com\/articles\/mocksArentStubs.html\" rel=\"noopener noreferrer nofollow\">Mocks Aren&#8217;t Stubs<\/a> \u041c\u0430\u0440\u0442\u0438\u043d\u0430 \u0424\u0430\u0443\u043b\u0435\u0440\u0430<\/p>\n<\/li>\n<li>\n<p>\u0422\u0440\u0435\u0442\u044c\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u044e\u0442 \u0446\u0435\u043b\u044b\u0445 \u043f\u044f\u0442\u044c \u0442\u0438\u043f\u043e\u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432 \u2014 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u043a\u043d\u0438\u0433\u0435 XUnit Test Patterns.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043e\u0431\u0441\u0443\u0434\u0438\u043c \u043f\u044f\u0442\u044c \u0442\u0438\u043f\u043e\u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432: Dummy, Stub, Spy, Mock, Fake.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u044f\u0442 \u0442\u0438\u043f\u043e\u043b\u043e\u0433\u0438\u044e \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432.<\/figcaption><\/div>\n<\/figure>\n<h2>\u041a\u0430\u043a \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0441\u0442\u0430\u0442\u044c\u044f<\/h2>\n<p>\u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0421\u0435\u0440\u0433\u0435\u0439 \u0428\u0430\u043c\u0431\u0438\u0440, \u0438 \u044f backend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 TravelLine (\u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e \u043d\u0430 C# \/ .NET).<\/p>\n<p>\u0422\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 4 \u0433\u043e\u0434\u0430 \u044f \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 backend-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0431\u044d\u043a-\u043e\u0444\u0438\u0441\u0430.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0435\u0441\u0442\u044c \u0434\u0432\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u043d\u044b\u0435 \u0447\u0435\u0440\u0442\u044b:<\/p>\n<ol>\n<li>\n<p>\u041c\u043d\u043e\u0433\u043e \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u041c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0439 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c\u0438 \u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 \u2014 \u043f\u0440\u0438\u0447\u0451\u043c \u0441\u043c\u0435\u0436\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0447\u0430\u0441\u0442\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445, \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0437\u043e\u043e\u043f\u0430\u0440\u043a \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f<\/p>\n<\/li>\n<\/ol>\n<blockquote>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u041c\u0430\u0440\u0442\u0438\u043d\u0430 \u0424\u0430\u0443\u043b\u0435\u0440\u0430 \u043d\u0430 \u0442\u0435\u043c\u0443 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0439: <a href=\"https:\/\/martinfowler.com\/articles\/cant-buy-integration.html\" rel=\"noopener noreferrer nofollow\">You Can&#8217;t Buy Integration<\/a>.<\/p>\n<\/blockquote>\n<p>\u042d\u0442\u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0435 \u0443\u0440\u043e\u0432\u043d\u0438 \u0442\u0435\u0441\u0442\u043e\u0432:<\/p>\n<ol>\n<li>\n<p>\u0412\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u0431\u043e\u0301\u043b\u044c\u0448\u0435\u0439 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0439 \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 API \u0432 \u043c\u043e\u0438\u0445 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u0430\u0445 \u043c\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432, \u0437\u0430\u043c\u0435\u043d\u044f\u044e\u0449\u0438\u0445 \u043d\u0435\u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0435 \u0432\u043d\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<li>\n<p>\u0422\u0430\u043a\u0436\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0443\u0431\u043b\u0451\u0440\u044b \u0432 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u0430\u0445, \u0437\u0430\u043c\u0435\u043d\u044f\u044f \u0432\u0441\u0435 Collaborator Objects \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 (\u0435\u0441\u043b\u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043e\u043d \u0441 \u043a\u0435\u043c-\u0442\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442)<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u0442\u0435\u0441\u0442\u0430\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435: \u044f \u0444\u043e\u043a\u0443\u0441\u0438\u0440\u0443\u044e\u0441\u044c \u043d\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u0451\u043c\u043e\u0447\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u0430\u0445. \u042d\u0442\u043e\u0442 \u0442\u0438\u043f \u0442\u0435\u0441\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043a\u0440\u0430\u0442\u043a\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<ol>\n<li>\n<p>\u041e\u043d\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u044f\u0437\u044b\u043a\u043e\u043c, \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u0430\u043c \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u044f\u0437\u044b\u043a Gherkin (\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <a href=\"https:\/\/reqnroll.net\" rel=\"noopener noreferrer nofollow\">Reqnroll<\/a>); \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0442\u0435\u0441\u0442\u044b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u044e\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0443 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435, \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u043c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443<\/p>\n<ul>\n<li>\n<p>\u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u044d\u0442\u043e <em>\u043f\u0440\u0438\u0451\u043c\u043e\u0447\u043d\u044b\u0435<\/em> \u0442\u0435\u0441\u0442\u044b (<em>\u0430\u043d\u0433\u043b.<\/em> Acceptance Tests, \u0438\u043b\u0438 Customer Tests \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 Extreme Programming)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u041e\u043d\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u044e\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043a\u0430\u043a \u0447\u0451\u0440\u043d\u044b\u0439 \u044f\u0449\u0438\u043a (Black Box), \u0442\u043e \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/p>\n<ul>\n<li>\n<p>\u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u044d\u0442\u043e <em>\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435<\/em> \u0442\u0435\u0441\u0442\u044b (<em>\u0430\u043d\u0433\u043b<\/em>. Functional Tests)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u041e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u0421\u0423\u0411\u0414 \u0432 docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u043d\u043e \u0437\u0430\u043c\u0435\u043d\u044f\u044e\u0442 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c\u0438 \u0434\u0443\u0431\u043b\u0451\u0440\u0430\u043c\u0438 \u0432\u0441\u0435 \u043d\u0435\u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0435 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 (\u0432\u043a\u043b\u044e\u0447\u0430\u044f API \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432)<\/p>\n<ul>\n<li>\n<p>\u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u044d\u0442\u043e <em>\u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435<\/em> \u0442\u0435\u0441\u0442\u044b \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c \u043a\u043d\u0438\u0433\u0438 \u00ab\u041f\u0440\u0438\u043d\u0446\u0438\u043f\u044b Unit-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\u00bb \u0412\u043b\u0430\u0434\u0438\u043c\u0438\u0440\u0430 \u0425\u043e\u0440\u0438\u043a\u043e\u0432\u0430<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e \u043c\u043e\u0434\u0435\u043b\u0438 <a href=\"https:\/\/testing.googleblog.com\/2010\/12\/test-sizes.html\" rel=\"noopener noreferrer nofollow\">Test Sizes \u043e\u0442 Google<\/a>, \u043e\u043d\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0442\u0435\u0441\u0442\u0430\u043c\u0438 <em>\u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430<\/em> (<em>\u0430\u043d\u0433\u043b.<\/em> Medium Size)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0441\u043b\u0443\u0436\u0430\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c, \u043e\u0434\u043d\u0430\u043a\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0432\u043a\u043b\u0430\u0434 \u0432 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u043a\u043e\u0434\u0435 \u0438 \u0432 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u043d\u043e\u0441\u044f\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u0451\u043c\u043e\u0447\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b.<\/p>\n<h2>\u041a\u0430\u043a \u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e<\/h2>\n<p>\u042f \u043f\u043e\u043b\u0430\u0433\u0430\u044e, \u0447\u0442\u043e \u0443 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043e\u043f\u044b\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f Mock-\u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432 \u0432\u0440\u0443\u0447\u043d\u0443\u044e.<\/p>\n<p>\u0410 \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u043e\u043f\u044b\u0442\u0430 \u043d\u0435\u0442, \u0442\u043e \u043f\u0440\u043e\u043b\u0438\u0441\u0442\u0430\u0439\u0442\u0435 \u0441\u0442\u0430\u0442\u044c\u044e \u0432\u043d\u0438\u0437 \u0434\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438 \u0438\u0437\u0443\u0447\u0438\u0442\u0435 \u0438\u0445, \u0430 \u043f\u043e\u0442\u043e\u043c \u0432\u0435\u0440\u043d\u0438\u0442\u0435\u0441\u044c \u0432 \u043d\u0430\u0447\u0430\u043b\u043e.<\/p>\n<h2>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0434\u0443\u0431\u043b\u0451\u0440<\/h2>\n<p>\u0422\u0435\u0440\u043c\u0438\u043d \u00ab\u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0434\u0443\u0431\u043b\u0451\u0440\u00bb (<em>\u0430\u043d\u0433\u043b<\/em>. Test Double) \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0442 \u043a\u0438\u043d\u0435\u043c\u0430\u0442\u043e\u0433\u0440\u0430\u0444\u0430:<\/p>\n<ul>\n<li>\n<p>\u0432 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0430\u043a\u0442\u0451\u0440\u043e\u0432 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 double<\/p>\n<\/li>\n<li>\n<p>\u043a\u0430\u0441\u043a\u0430\u0434\u0451\u0440\u043e\u0432, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 stunt double<\/p>\n<\/li>\n<\/ul>\n<h2>\u041f\u044f\u0442\u044c \u0442\u0438\u043f\u043e\u0432 \u043a\u0440\u0430\u0442\u043a\u043e<\/h2>\n<p>\u0414\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<ol>\n<li>\n<p><strong>Dummy<\/strong> \u2014 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0434\u0443\u0431\u043b\u0451\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u0438 \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<li>\n<p><strong>Stub<\/strong> \u2014 \u0434\u0443\u0431\u043b\u0451\u0440, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0434 \u043e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0432\u0432\u043e\u0434\u043e\u043c (indirect input) \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/p>\n<\/li>\n<li>\n<p><strong>Spy<\/strong> \u2014 \u0434\u0443\u0431\u043b\u0451\u0440, \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0432\u0435\u0441\u044c \u043e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 (indirect output) \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/p>\n<\/li>\n<li>\n<p><strong>Mock<\/strong> \u2014 \u0434\u0443\u0431\u043b\u0451\u0440, \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u043e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u0441 <em>\u0437\u0430\u0440\u0430\u043d\u0435\u0435<\/em> \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f\u043c\u0438<\/p>\n<\/li>\n<li>\n<p><strong>Fake<\/strong> \u2014 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0430\u044f \u0438 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u0430\u044f, \u043d\u043e \u0444\u0430\u043b\u044c\u0448\u0438\u0432\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430<\/p>\n<\/li>\n<\/ol>\n<blockquote>\n<p>\u0422\u0435\u0440\u043c\u0438\u043d\u044b \u00ab\u043e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u0432\u043e\u0434\u00bb \u0438 \u00ab\u043e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434\u00bb \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0434\u0430\u043b\u0435\u0435.<\/p>\n<\/blockquote>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432<\/h3>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p align=\"left\"><strong>\u0422\u0438\u043f \u0434\u0443\u0431\u043b\u0451\u0440\u0430<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"195\" width=\"195\">\n<p align=\"left\"><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043b\u0430\u0441\u0441\u0430<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p align=\"left\">Dummy<\/p>\n<\/td>\n<td data-colwidth=\"195\" width=\"195\">\n<p align=\"left\">DummyLogger<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 ILogger, \u043d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p align=\"left\">Stub<\/p>\n<\/td>\n<td data-colwidth=\"195\" width=\"195\">\n<p align=\"left\">StubCurrencyDataSource<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0432\u0430\u043b\u044e\u0442\u0430\u0445, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0439 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p align=\"left\">Spy<\/p>\n<\/td>\n<td data-colwidth=\"195\" width=\"195\">\n<p align=\"left\">SpyMailSender<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 IMailSender. \u041d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442, \u043d\u043e \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0438\u0441\u044c\u043c\u0430 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0442\u0435\u0441\u0442\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0438\u0445.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p align=\"left\">Mock<\/p>\n<\/td>\n<td data-colwidth=\"195\" width=\"195\">\n<p align=\"left\">MockMailSender<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 IMailSender. \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u0441\u0442\u043e\u043c \u043d\u0430 \u0448\u0430\u0433\u0435 Arrange (Given), \u0430 \u043d\u0430 \u0448\u0430\u0433\u0435 Act (When) \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u043f\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c \u0438 \u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c. <\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p align=\"left\">Fake<\/p>\n<\/td>\n<td data-colwidth=\"195\" width=\"195\">\n<p align=\"left\">FakeUserRepository<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 IUserRepository. \u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043d\u0435\u043e\u0442\u043b\u0438\u0447\u0438\u043c \u043e\u0442 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f. \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u0444\u0430\u043b\u044c\u0448\u0438\u0432\u043a\u0430: \u043e\u043d \u0445\u0440\u0430\u043d\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435 \u0432 \u0411\u0414, \u0430 \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<blockquote>\n<p>\u0420\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0448\u0430\u0433\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \u2014 Arrange, Act, Assert (\u043e\u043d\u0438 \u0436\u0435 Given, When, Then \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 BDD) \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0434\u0430\u043b\u0435\u0435.<\/p>\n<\/blockquote>\n<h2>\u0410\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c\u0438 \u0434\u0443\u0431\u043b\u0451\u0440\u0430\u043c\u0438<\/h2>\n<h3>1. \u041c\u043e\u0434\u0435\u043b\u044c \u043e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430\/\u0432\u044b\u0432\u043e\u0434\u0430<\/h3>\n<p>\u042d\u0442\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u0438\u043f \u0434\u0443\u0431\u043b\u0451\u0440\u0430, \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438.<\/p>\n<p>\u041e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u0432\u043e\u0434 \/ \u0432\u044b\u0432\u043e\u0434 (<em>\u0430\u043d\u0433\u043b<\/em>. indirect input \/ output) \u2014 \u044d\u0442\u043e \u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 (SUT) \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 (Collaborators):<\/p>\n<ul>\n<li>\n<p>\u041e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u0432\u043e\u0434 \u2014 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0447\u0438\u0442\u0430\u0435\u0442 \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \/ \u0441\u0438\u0441\u0442\u0435\u043c<\/p>\n<\/li>\n<li>\n<p>\u041e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u2014 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u0438\u0448\u0435\u0442 \u0432 \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \/ \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><\/figure>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \/ \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0431\u044b\u0432\u0430\u0435\u0442 \u0442\u0440\u0451\u0445 \u0442\u0438\u043f\u043e\u0432:<\/p>\n<ol>\n<li>\n<p>\u0422\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \/ \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u2014 \u043e\u0434\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u0442.\u0435. \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u0432\u043e\u0434<\/p>\n<\/li>\n<li>\n<p>\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \/ \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u2014 \u043e\u0434\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u0442.\u0435. \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434<\/p>\n<\/li>\n<li>\n<p>\u0427\u0442\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u2014 \u0434\u0432\u0443\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435<\/p>\n<\/li>\n<\/ol>\n<h4>\u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b<\/h4>\n<p>\u0420\u0430\u0441\u043a\u0438\u0434\u0430\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0432\u044b\u0448\u0435 \u043f\u043e \u0442\u0438\u043f\u0443 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u043c:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"195\" width=\"195\">\n<p align=\"left\"><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043b\u0430\u0441\u0441\u0430<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>\u0421\u043f\u043e\u0441\u043e\u0431 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u043c<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>\u0427\u0442\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0434\u0443\u0431\u043b\u0451\u0440<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"195\" width=\"195\">\n<p align=\"left\">DummyLogger<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0417\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041d\u0438\u043a\u0443\u0434\u0430 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u0438\u0448\u0435\u0442<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"195\" width=\"195\">\n<p align=\"left\">StubCurrencyDataSource<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0427\u0442\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"195\" width=\"195\">\n<p align=\"left\">SpyMailSender<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0417\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0417\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, \u0447\u0442\u043e\u0431\u044b \u0442\u0435\u0441\u0442 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b \u0438\u0445<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"195\" width=\"195\">\n<p align=\"left\">MockMailSender<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0417\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 \u0432\u044b\u0437\u043e\u0432\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f\u043c\u0438<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"195\" width=\"195\">\n<p align=\"left\">FakeUserRepository<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0414\u0432\u0443\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435 (\u0447\u0442\u0435\u043d\u0438\u0435\/\u0437\u0430\u043f\u0438\u0441\u044c)<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0425\u0440\u0430\u043d\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h4>\u041e\u0431\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430<\/h4>\n<p>\u041c\u043e\u0436\u0435\u043c \u043e\u0431\u043e\u0431\u0449\u0438\u0442\u044c, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044f \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043a \u043e\u0431\u0449\u0438\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"101\" width=\"101\">\n<p align=\"left\"><strong>\u0422\u0438\u043f \u0434\u0443\u0431\u043b\u0451\u0440\u0430<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"414\" width=\"414\">\n<p align=\"left\"><strong>\u0421\u043f\u043e\u0441\u043e\u0431 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u043c<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"101\" width=\"101\">\n<p align=\"left\">Dummy<\/p>\n<\/td>\n<td data-colwidth=\"414\" width=\"414\">\n<p align=\"left\">\u043b\u044e\u0431\u043e\u0439, \u043e\u0431\u044b\u0447\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"101\" width=\"101\">\n<p align=\"left\">Stub<\/p>\n<\/td>\n<td data-colwidth=\"414\" width=\"414\">\n<p align=\"left\">\u0447\u0442\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"101\" width=\"101\">\n<p align=\"left\">Spy<\/p>\n<\/td>\n<td data-colwidth=\"414\" width=\"414\">\n<p align=\"left\">\u0437\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043b\u0438\u0431\u043e \u0434\u0432\u0443\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435 (Spy+Stub)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"101\" width=\"101\">\n<p align=\"left\">Mock<\/p>\n<\/td>\n<td data-colwidth=\"414\" width=\"414\">\n<p align=\"left\">\u0437\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043b\u0438\u0431\u043e \u0434\u0432\u0443\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435 (Mock+Stub)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"101\" width=\"101\">\n<p align=\"left\">Fake<\/p>\n<\/td>\n<td data-colwidth=\"414\" width=\"414\">\n<p align=\"left\">\u043b\u044e\u0431\u043e\u0439, \u043e\u0431\u044b\u0447\u043d\u043e \u0434\u0432\u0443\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h4>Spy+Stub \u0438 Mock+Stub<\/h4>\n<p>\u0414\u0443\u0431\u043b\u0451\u0440\u044b \u0442\u0438\u043f\u043e\u0432 Spy \u0438 Mock \u043c\u043e\u0433\u0443\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442\u044c \u0442\u0438\u043f\u0443 Stub, \u0442\u043e \u0435\u0441\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0434\u0443\u0431\u043b\u0451\u0440 \u0441\u043e\u0447\u0435\u0442\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 Spy \u0438 Stub, \u0442\u043e \u043e\u043d \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0432\u0435\u0441\u044c \u0432\u044b\u0432\u043e\u0434 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u0432\u0432\u043e\u0434<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0434\u0443\u0431\u043b\u0451\u0440 \u0441\u043e\u0447\u0435\u0442\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 Mock \u0438 Stub, \u0442\u043e \u043e\u043d \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f\u043c\u0438 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432 \u043e\u0442\u0432\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 Mock<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u043c\u0435\u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432 \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0441\u043b\u043e\u0432\u043e Spy \u0438\u043b\u0438 Mock, \u043d\u043e \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0441\u043b\u043e\u0432\u0430 Stub.<\/p>\n<h3>2. \u041c\u043e\u0434\u0435\u043b\u044c Arrange-Act-Assert<\/h3>\n<p>\u0420\u0430\u0437\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0448\u0430\u0433\u0430\u0445 \u0442\u0435\u0441\u0442\u0430.<\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0435 \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u043f\u043e \u043c\u043e\u0434\u0435\u043b\u0438 AAA: Arrange, Act, Assert<\/p>\n<ol>\n<li>\n<p>\u041d\u0430 \u0448\u0430\u0433\u0435 <strong>Arrange<\/strong> \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 (\u043c\u0435\u0442\u043e\u0434\u043e\u0432)<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430 \u0448\u0430\u0433\u0435 <strong>Act<\/strong> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u044b\u0437\u043e\u0432 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f (\u043c\u0435\u0442\u043e\u0434\u0430)<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430 \u0448\u0430\u0433\u0435 <strong>Assert<\/strong> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432<\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0430\u0432\u0442\u043e\u0440\u044b \u0432\u044b\u0434\u0435\u043b\u044f\u044e\u0442 \u0447\u0435\u0442\u0432\u0451\u0440\u0442\u044b\u0439 \u0448\u0430\u0433 \u2014 <strong>Cleanup<\/strong> \u0438\u043b\u0438 <strong>Teardown<\/strong> \u2014 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0439 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0438 \u043e\u0442\u043a\u0430\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0445 \u043f\u043e\u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u0442\u0435\u0441\u0442\u044b.<\/p>\n<h4>\u041c\u0438\u043d\u0443\u0442\u043a\u0430 BDD<\/h4>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 Behavior Driven Development, \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043c\u0435\u043d\u0430 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0439: \u0432\u043c\u0435\u0441\u0442\u043e Arrange \/ Act \/ Assert \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0433\u043b\u0430\u0433\u043e\u043b\u044b Given \/ When \/ Then.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430-\u0442\u043e \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u044f \u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u0441\u043c\u0435\u043d\u0430 \u0433\u043b\u0430\u0433\u043e\u043b\u043e\u0432 \u2014 \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0441\u0443\u0442\u044c BDD (<em>\u0445\u0430-\u0445\u0430<\/em>!). \u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u044f \u0441\u0447\u0438\u0442\u0430\u043b BDD \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u043e\u0439.<\/p>\n<p>\u0421\u0443\u0442\u044c BDD \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043d\u0435 \u0432 \u0433\u043b\u0430\u0433\u043e\u043b\u0430\u0445, \u0430 \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043f\u0440\u0438\u0451\u043c\u043e\u0447\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 (\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432) \u043d\u0430 \u044f\u0437\u044b\u043a\u0435, \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u043c \u0432\u0441\u0435\u043c \u0447\u043b\u0435\u043d\u0430\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u2014 product owner, \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430\u043c, \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430\u043c, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c<\/p>\n<ul>\n<li>\n<p>\u0415\u0441\u043b\u0438 BDD \u0441\u043e\u0447\u0435\u0442\u0430\u0435\u0442\u0441\u044f \u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0447\u0435\u0440\u0435\u0437 User Story (\u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c Acceptance Criteria \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0418\u0441\u0442\u043e\u0440\u0438\u0438), \u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 \u043f\u043e\u0437\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442 \u0434\u043b\u044f \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0439 \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043a\u0430\u043a \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043c\u0435\u0436\u0434\u0443 \u0441\u043c\u0435\u0436\u043d\u044b\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 \u0438 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043b\u044f\u043c\u0438 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 BDD \u0441\u043e\u0447\u0435\u0442\u0430\u0435\u0442\u0441\u044f \u0441 \u044f\u0437\u044b\u043a\u043e\u043c Gherkin, \u0442\u043e \u0442\u0435\u0441\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u043c\u0438 \u0438 \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u044b\u043c\u0438 \u043a \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0443<\/p>\n<\/li>\n<\/ul>\n<p>\u041e \u0442\u0435\u0441\u0442\u0430\u0445 \u043d\u0430 Gherkin \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/habr.com\/ru\/articles\/860932\/\" rel=\"noopener noreferrer nofollow\">\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0434\u043b\u044f ASP.NET Core<\/a>, \u0430 \u043d\u0438\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430:<\/p>\n<pre><code class=\"yaml\">\u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439: \u041c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u0434\u0438\u043d     \u041f\u0443\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b:       | \u041a\u043e\u0434    | \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435                   | \u0426\u0435\u043d\u0430  | \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e |       | A12345 | \u0427\u0442\u043e-\u0442\u043e \u0438\u0437 \u043b\u044c\u043d\u044f\u043d\u043e\u0433\u043e \u0432\u043e\u043b\u043e\u043a\u043d\u0430 | 49,90 | 300        |       | B99999 | \u0416\u0435\u043d\u0441\u043a\u0438\u0439 \u043e\u0431\u043e\u0434\u043e\u043a \u0434\u043b\u044f \u0432\u043e\u043b\u043e\u0441   | 99,00 | 12         |      \u041a\u043e\u0433\u0434\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b:       | \u041a\u043e\u0434    | \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435                    | \u0426\u0435\u043d\u0430  | \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e |       | A12345 | \u0424\u0443\u0444\u0430\u0439\u043a\u0430 \u0438\u0437 \u043b\u044c\u043d\u044f\u043d\u043e\u0433\u043e \u0432\u043e\u043b\u043e\u043a\u043d\u0430 | 49,90 | 400        |      \u0422\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432:       | \u041a\u043e\u0434    | \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435                    | \u0426\u0435\u043d\u0430  | \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e |       | A12345 | \u0424\u0443\u0444\u0430\u0439\u043a\u0430 \u0438\u0437 \u043b\u044c\u043d\u044f\u043d\u043e\u0433\u043e \u0432\u043e\u043b\u043e\u043a\u043d\u0430 | 49,90 | 400        |       | B99999 | \u0416\u0435\u043d\u0441\u043a\u0438\u0439 \u043e\u0431\u043e\u0434\u043e\u043a \u0434\u043b\u044f \u0432\u043e\u043b\u043e\u0441    | 99,00 | 12         |<\/code><\/pre>\n<h4>\u0422\u0438\u043f\u044b \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432 \u0438 \u0448\u0430\u0433\u0438 AAA<\/h4>\n<p>\u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u043d\u0430\u0448\u0438\u043c \u0434\u0443\u0431\u043b\u0451\u0440\u0430\u043c \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0445 \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u044c \u0441 \u0448\u0430\u0433\u0430\u043c\u0438 AAA.<\/p>\n<p>\u0412\u0441\u0435 \u0442\u0438\u043f\u044b \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432 \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u0432\u043d\u0435\u0434\u0440\u044f\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u2014\u00a0\u0447\u0435\u0440\u0435\u0437 DI-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043b\u0438\u0431\u043e \u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u0432\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u0434\u0443\u0431\u043b\u0451\u0440\u0430 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0448\u0430\u0433\u0430\u043c\u0438 \u0442\u0435\u0441\u0442\u0430.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"199\" width=\"199\">\n<p align=\"left\"><strong>\u0422\u0438\u043f \u0434\u0443\u0431\u043b\u0451\u0440\u0430<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>\u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0448\u0430\u0433\u0438 AAA<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"199\" width=\"199\">\n<p align=\"left\">Dummy<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2014<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"199\" width=\"199\">\n<p align=\"left\">Stub<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041d\u0430 \u0448\u0430\u0433\u0435 Arrange \u0432 Stub \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"199\" width=\"199\">\n<p align=\"left\">Spy<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041d\u0430 \u0448\u0430\u0433\u0435 Assert \u0438\u0437 Spy \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"199\" width=\"199\">\n<p align=\"left\">Mock<\/p>\n<\/td>\n<td>\n<p align=\"left\">Mock \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0448\u0430\u0433\u0435 Arrange (\u043b\u0438\u0431\u043e \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 Setup), \u0438 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430 \u0448\u0430\u0433\u0435 Act.<\/p>\n<p align=\"left\">\u0418\u043d\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043e\u0442\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u043e \u0448\u0430\u0433\u0430 Assert (\u0435\u0441\u043b\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u044f\u0432\u043d\u043e).<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"199\" width=\"199\">\n<p align=\"left\">Fake<\/p>\n<\/td>\n<td>\n<p align=\"left\">Fake \u0434\u043e\u043b\u0436\u0435\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u0431\u0435\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432 \u0442\u0435\u0441\u0442\u0435.<\/p>\n<p align=\"left\">\u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0442\u0435\u0441\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 Fake, \u0438\u0437\u043c\u0435\u043d\u044f\u044f \u0435\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043d\u0430 \u0448\u0430\u0433\u0435 Arrange \u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044f \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043d\u0430 \u0448\u0430\u0433\u0435 Assert.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0443\u0431\u043b\u0451\u0440\u043e\u0432 \u043d\u0430 C#<\/h2>\n<p>\u041e\u0431\u0449\u0438\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-444476","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/444476","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=444476"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/444476\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=444476"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=444476"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=444476"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}