{"id":192720,"date":"2013-09-06T12:13:02","date_gmt":"2013-09-06T08:13:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=192720"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=192720","title":{"rendered":"<span class=\"post_title\">Data-Driven \u0442\u0435\u0441\u0442\u044b \u0432 MS-Test \u0434\u043b\u044f \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0433\u043e \u0438 \u043f\u0440\u0438\u0451\u043c\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/256\/734\/927\/2567349277b1c1f5ce36cafabcfbd482.png\" align=\"right\"\/>\u042f \u0431\u044b \u0441\u0440\u0430\u0437\u0443 \u0445\u043e\u0442\u0435\u043b \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u044c \u0442\u043e\u0442 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u043c\u0438\u0440 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u043c\u0438\u0440 \u043f\u0440\u0438\u0451\u043c\u043e\u0447\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u2013 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u043c\u0438\u0440\u044b: \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u0437\u0430\u043a\u043e\u043d\u0430\u043c\u0438, \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438. \u0418 \u0435\u0441\u043b\u0438 \u043c\u0438\u0440 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0432 \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u0438, \u0442\u043e \u0442\u0435\u0441\u0442\u044b \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u2013 \u044d\u0442\u043e \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439, \u043f\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043a\u043d\u043e\u043f\u043e\u043a \u0438 \u043d\u0430\u0431\u043e\u0440 \u0442\u0435\u043a\u0441\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u0438\u0442\u043e\u0433\u0435 \u0441\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0431\u043e\u043b\u0435\u0435 \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u0431\u0438\u0437\u043d\u0435\u0441-\u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438. <\/p>\n<p>  \u041d\u0435 \u0440\u0435\u0434\u043a\u043e \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a, \u0447\u0442\u043e \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u2013 \u0442\u043e \u044d\u0442\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u044b \u0434\u043b\u044f UI-\u0442\u0435\u0441\u0442\u043e\u0432. <\/p>\n<p>  \u0422\u0430\u043a \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0438 \u0432 \u043c\u043e\u0435\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435, \u043a\u043e\u0433\u0434\u0430 \u044f \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c data-driven \u0442\u0435\u0441\u0442\u044b \u0432 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 Ms-Test. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u043e\u043f\u0438\u0448\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0438 \u0441\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043d\u0435 \u043f\u043e\u0439\u043c\u0443 \u2013 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0433\u043e\u0440\u0434\u0438\u0442\u044c\u0441\u044f \u0438\u043b\u0438 \u0441\u0442\u044b\u0434\u0438\u0442\u044c\u0441\u044f. <br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>Data-Driven \u043f\u043e\u0434\u0445\u043e\u0434 \u0432 \u043c\u0438\u0440\u0435 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 <\/h4>\n<p>  \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434 int ConvertToNumber(string input), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430 \u0432\u0445\u043e\u0434 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u0447\u0438\u0441\u043b\u043e\u043c \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u044d\u0442\u043e \u0436\u0435 \u0447\u0438\u0441\u043b\u043e, \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u043c \u0442\u0438\u043f\u0435. <\/p>\n<p>  \u041f\u0443\u0441\u0442\u044c \u043c\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043e\u0434\u0438\u043d \u043f\u043e\u0437\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u0442\u0435\u0441\u0442, (<a href=\"http:\/\/blog.zhariy.com\/2012\/07\/blog-post_11.html\">\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043d\u043e\u0441\u0438\u0442 \u0440\u0430\u0434\u043e\u0441\u0442\u044c<\/a>) \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f input = \u201c3\u201d \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u0436\u0435 3. <\/p>\n<p>  \u0427\u0442\u043e \u0435\u0449\u0435? \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0433\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438 \u043a\u043b\u0430\u0441\u0441\u044b \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u0438: \u201c-1\u201d, \u201c0\u201d, \u201cMaxInt\u201d, \u201c-(MaxInt)\u201d.<br \/>  \u0425\u043e\u0440\u043e\u0448\u043e, \u0430 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043d\u0430 \u0432\u0445\u043e\u0434 \u043f\u043e\u043f\u0430\u0434\u0435\u0442 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u0430\u044f \u0434\u0440\u043e\u0431\u044c? \u0410 \u0435\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u0446\u0438\u0444\u0440\u044b, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0442 \u0441\u0438\u043c\u0432\u043e\u043b\u044b? <\/p>\n<p>  \u041a\u0430\u043a\u043e\u0432\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432 \u0442\u0430\u043a\u0438\u0445 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445? <br \/>  \u0410 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u2013 \u043d\u0435\u0442. <\/p>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u044f\u0437\u044b\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 \u0442\u0430\u043a\u0438\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, JavaScript \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 { \u201c10\u201d + 1} \u0432\u0435\u0440\u043d\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u201c101\u201d, \u0430 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 { \u201c10\u201d \u2014 1} \u0431\u0443\u0434\u0435\u0442 \u0447\u0438\u0441\u043b\u043e 9. \u0410 Perl \u0441\u043a\u0430\u0436\u0435\u0442: 11 \u0438 9 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u041d\u043e, \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u00ab\u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0433\u043e\u00bb \u043e\u0442\u0432\u0435\u0442\u0430 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u043d\u0430\u043c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0438 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u0442\u043d\u044b\u043d\u0435 \u2013 \u044d\u0442\u043e \u0435\u0441\u043c\u044c \u0438\u0441\u0442\u0438\u043d\u0430, \u0438 \u0432\u044b\u0441\u0435\u0447\u044c \u044d\u0442\u0443 \u0438\u0441\u0442\u0438\u043d\u0443 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0432 \u043a\u0430\u043c\u043d\u0435. <\/p>\n<p>  \u041d\u043e, \u043d\u0435\u0443\u0436\u0435\u043b\u0438 \u0432\u044b \u0441\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u043d\u0430\u043a\u043e\u043f\u0438-\u043f\u0430\u0441\u0442\u0438\u0442\u044c \u0434\u044e\u0436\u0438\u043d\u0443 \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u043e\u0432 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u043d\u0435\u0441\u0447\u0430\u0441\u0442\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0441 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c? <br \/>  \u0410 \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0438 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0442\u0430\u043a\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043a\u0430\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0432 \u043e\u0434\u0438\u043d \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442. <br \/>  \u0412\u043d\u0430\u0447\u0430\u043b\u0435, \u044f \u0441\u0430\u043c \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u0438\u0432\u0438\u043b\u0441\u044f, \u0447\u0442\u043e Ms-Test \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u0433\u0430\u0442\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e. <\/p>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 data-driven \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u043d\u0430 Ms-Test<\/h4>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 ConvertToNumber, \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Convert.ToInt32() \u2013\u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u043e. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e, \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0443 \u0441\u0432\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e:  <\/p>\n<pre><code class=\"cs\">static int ConvertToNumber(string input) {     int result = 0;     while (input.Length &gt; 0)         result = (input[0] &gt;= '0'         || input[0] &lt;= '9') ? (result         * 10) + input[0] - '0' + (((input         = input.Remove(0, 1)).Length         &gt; 0) ? 0 : 0) : 0;     return result; } <\/code><\/pre>\n<p>  \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432 Ms-Test \u043f\u043e\u043a\u0430 \u043d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u0434\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0438 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u043a\u043e\u0434\u0435, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432. \u0417\u0430\u0442\u043e, \u0435\u0441\u0442\u044c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 \u2013 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u0418 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430, \u0432\u044b \u043d\u0435 \u043f\u043e\u0432\u0435\u0440\u0438\u0442\u0435, \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Excel-\u0444\u0430\u0439\u043b. <\/p>\n<p>  \u0425\u043e\u0442\u044f, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0434\u0430\u043d\u043d\u044b\u0445, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0438\u0437 .NET. \u0412 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 CSV, XML \u0438 \u0434\u0440\u0443\u0433\u0438\u0435. <br \/>  \u041d\u043e, \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 Excel \u2013 \u044d\u0442\u043e \u0436\u0435 \u043a\u0440\u0443\u0442\u043e! \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430\u0448\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<p>  <a href=\"http:\/\/4.bp.blogspot.com\/-lRDree7fCDM\/UikjTSqS1aI\/AAAAAAAADQQ\/cFWmYFZbG0U\/s1600\/agen-smith-large.png\"><img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/79d\/c55\/8b6\/79dc558b6ecae16c1a0f55c200855930.png\"\/><\/a><\/p>\n<p>  \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u2013 \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043a\u0430\u043a \u00ab\u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u0441 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c\u00bb. \u0418\u043d\u0430\u0447\u0435 \u2013 \u043c\u0430\u0433\u0438\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. <\/p>\n<p>  \u0422\u043e\u0433\u0434\u0430 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u0441\u0442 \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 Excel-\u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439 \u0438 \u0447\u0442\u0435\u043d\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cs\">const string dataDriver = &quot;System.Data.OleDb&quot;; const string connectionStr = &quot;Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\\\matrix.xlsx;Extended Properties=\\&quot;Excel 12.0 Xml;HDR=YES\\&quot;;&quot;;  [TestMethod] [DataSource(dataDriver, connectionStr, &quot;Shit1$&quot;, DataAccessMethod.Sequential)] public void TestMe() {     string rowInput     = TestContext.DataRow[&quot;Input&quot;].ToString();     string rowExpected  = TestContext.DataRow[&quot;Expected Result&quot;].ToString();     string rowException = TestContext.DataRow[&quot;Exception&quot;].ToString();     string rowComment   = TestContext.DataRow[&quot;Comment&quot;].ToString();      int actualResult = ConvertToNumber(rowInput);     Assert.AreEqual(rowExpected, actualResult.ToString()); } <\/code><\/pre>\n<p>  \u0414\u0430, \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0437\u0430\u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u0441\u0438\u043b\u0438\u0439 \u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u043e, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043a\u0430\u043a\u0438\u0435 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438.<\/p>\n<p>  <a href=\"http:\/\/2.bp.blogspot.com\/-5lZE1M1SGcc\/UikjUCL11FI\/AAAAAAAADQg\/z7UMzZKLZXk\/s1600\/test-results-large.png\"><img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/174\/29a\/196\/17429a196a7a4ba8fac5be430363c13a.png\"\/><\/a><\/p>\n<p>  \u0410 \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0442\u0435\u0441\u0442 \u2013 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 Excel. \u0418 \u0432 \u043a\u043e\u0434 \u043b\u0435\u0437\u0442\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0447\u0442\u043e \u0436\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u043f\u043e\u043a\u0440\u044b\u0442\u043e, \u0430 \u0447\u0442\u043e \u2013 \u043d\u0435\u0442. <\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0439\u0442\u0438 \u0432 \u043b\u044e\u0431\u043e\u0439 \u0438\u0437 \u0442\u0435\u0441\u0442\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u0435\u0442\u0430\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438\u043b\u0438 \u043b\u043e\u0433. <\/p>\n<p>  \u041f\u0440\u043e\u0448\u0443 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u0436\u0435 \u043d\u0430 \u043c\u043e\u0435\u0439 \u043d\u0438\u0437\u043a\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435, \u0432\u0441\u0435 14 \u0442\u0435\u0441\u0442\u043e\u0432 \u043f\u0440\u043e\u0448\u043b\u0438 \u0437\u0430 \u043c\u0435\u043d\u0435\u0435 \u0447\u0435\u043c \u0437\u0430 1 \u0441\u0435\u043a\u0443\u043d\u0434\u0443. <\/p>\n<p>  \u041d\u0435 \u0437\u043d\u0430\u044e \u043a\u0430\u043a \u0432\u044b, \u043d\u043e \u044f \u0431\u044b\u043b \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d \u0442\u0430\u043a\u0438\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0438 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u044b\u043c\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438. <br \/>  <u>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/u> \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0451 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e, \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b matrix.xlsx \u0432 \u043a\u043e\u0440\u0435\u043d\u044c \u0434\u0438\u0441\u043a\u0430 C:\\<\/p>\n<h4>Data-Driven \u043f\u043e\u0434\u0445\u043e\u0434 \u0432 \u043c\u0438\u0440\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441<\/h4>\n<p>  \u041a \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u043c\u0443 \u043c\u043e\u0435\u043c\u0443 \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u044f \u0432\u0437\u044f\u043b\u0441\u044f \u0437\u0430 UI-\u0442\u0435\u0441\u0442\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Selenium WebDriver \u2013 \u043c\u043e\u0435\u043c\u0443 \u0432\u043e\u0441\u0445\u0438\u0449\u0435\u043d\u0438\u044e \u043e\u0442 \u043c\u0435\u0433\u0430-\u043a\u0440\u0443\u0442\u043e\u0439 \u0444\u0438\u0447\u0438 Ms-Test \u043f\u0440\u0438\u0448\u0451\u043b \u043a\u043e\u043d\u0435\u0446. <\/p>\n<p>  \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e UI-\u0442\u0435\u0441\u0442\u044b \u0432 \u043b\u044e\u0431\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u0438\u0440\u043e\u0434\u0435 \u043e\u0447\u0435\u043d\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0435, \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u043c\u0438. \u0422\u0443\u0442 \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u0432\u0437\u044f\u0442\u044c \u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u0437 \u044f\u0434\u0440\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0441 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u0436\u043e\u043d\u0433\u043b\u0438\u0440\u0443\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438. \u041d\u0435\u0442\u2026 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u2013 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u043a\u043b\u0438\u043a\u0430\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043a\u043d\u043e\u043f\u043e\u043a. <\/p>\n<p>  \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0432\u0441\u0435\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0439, \u043e\u0434\u0438\u043d UI-\u0442\u0435\u0441\u0442 \u043c\u043e\u0436\u0435\u0442 \u0438\u0434\u0442\u0438 \u043e\u0442 30-\u0442\u0438 \u0441\u0435\u043a\u0443\u043d\u0434 \u0434\u043e \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 \u043c\u0438\u043d\u0443\u0442. \u0412\u0441\u0451 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f.<\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e 1 \u0438\u0437 14 data-driven \u0442\u0435\u0441\u0442\u043e\u0432 \u0438\u0434\u0435\u0442 \u043e\u0434\u043d\u0443 \u043c\u0438\u043d\u0443\u0442\u0443 \u2013 \u0442\u043e \u0432\u0435\u0441\u044c \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u043e\u0439\u0434\u0435\u0442 \u0437\u0430 14 \u043c\u0438\u043d\u0443\u0442. <br \/>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u0435\u0431\u0435, \u0447\u0442\u043e \u043e\u0434\u0438\u043d \u0442\u0435\u0441\u0442 \u0443\u043f\u0430\u0434\u0451\u0442 \u043f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043a\u043d\u043e\u043f\u043e\u0447\u043a\u0430 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043d\u0435 \u0443\u0441\u043f\u0435\u043b\u0430 \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f\u2026<br \/>  \u041d\u0435 \u0431\u0435\u0434\u0430, \u0441\u043a\u0430\u0436\u0435\u0442\u0435 \u0432\u044b, \u0432\u0435\u0434\u044c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0438 \u043f\u0440\u043e\u0433\u043d\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043f\u0430\u0432\u0448\u0438\u0435 \u0442\u0435\u0441\u0442\u044b.<br \/>  \u041d\u0435\u0442. Ms-Test \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u043f\u0430\u0447\u043a\u0443 data-driven \u0442\u0435\u0441\u0442\u043e\u0432 \u043a\u0430\u043a \u043e\u0434\u0438\u043d \u0442\u0435\u0441\u0442. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u043f\u0440\u043e\u0433\u043d\u0430\u0442\u044c 1 \u0442\u0435\u0441\u0442 \u2013 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432\u0441\u0435 14 \u0432\u043d\u043e\u0432\u044c. \u0418 \u043d\u0435 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u0442\u0435 \u0442\u0435\u0441\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043b\u0438 \u0440\u0430\u043d\u044c\u0448\u0435 \u2013 \u0432\u0434\u0440\u0443\u0433 \u043d\u0435 \u0443\u043f\u0430\u0434\u0443\u0442. \u0410 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u043b\u0430\u0434\u043a\u0438, \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u043e\u0447\u043a\u0443 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0430, \u0430 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0430: Visual Studio \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442\u2026 \u043d\u043e, \u044d\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0438\u043b\u0438\u0439 \u0438 \u0437\u0430\u0442\u0440\u0430\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. <\/p>\n<p>  \u041d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043d\u0430\u0439\u0442\u0438 \u0441\u043f\u043e\u0441\u043e\u0431, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b \u043f\u0435\u0440\u0435\u043f\u0440\u043e\u0433\u043d\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043f\u0430\u0432\u0448\u0438\u0439 \u0442\u0435\u0441\u0442. \u0418 \u044f \u0442\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0430\u0448\u0435\u043b. <\/p>\n<h4>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438: \u00ab\u0446\u0438\u043a\u043b \u0447\u0435\u0440\u0435\u0437 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435\u00bb<\/h4>\n<p>  \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 2 \u0444\u0430\u0439\u043b\u0430: <a href=\"https:\/\/raw.github.com\/dzhariy\/mstest-rows\/master\/TestBase.cs\">TestBase.cs<\/a> \u0438<a href=\"https:\/\/raw.github.com\/dzhariy\/mstest-rows\/master\/TestRows.cs\"> TestRows.cs<\/a>. <\/p>\n<p>  \u0422\u043e\u0433\u0434\u0430 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0451\u043d \u201cMsTestRows.Rows.*\u201d, \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441\u044b TestRows_<b>01<\/b> \u2026 TestRows_<b>100<\/b>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0432 \u0441\u0435\u0431\u0435 \u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0434\u043e \u0441\u0442\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432. <\/p>\n<p>  \u0423\u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0439\u0442\u0435 \u0432\u0430\u0448 TestClass \u043e\u0442 TestRows_NN \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u0432 (NN). <\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435, Visual Studio \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430:   <\/p>\n<ul>\n<li>GetNextDataRow() \u2013 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u0430<\/li>\n<li>TestMethod() \u2013 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d \u0438\u0437 \u0442\u0435\u0441\u0442\u0430 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u0442 GetNextDataRow().<\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u0440\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">using System; using System.Text; using System.Collections.Generic; using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting;  namespace HabraDrivenTests {      \/\/ Custom Data Row      public class HabrDataRow     {         public string Input { get; set; }         public int Expected { get; set; }         public Type ExpectedException { get; set; }         public string Comment { get; set; }      }          [TestClass]     public class HabrTestInherienceLoop : MsTestRows.Rows.TestRows_04&lt;HabrDataRow&gt;     {         \/\/ Production-ready method         static int ConvertToNumber(string input)         {             int result = 0;             while (input.Length &gt; 0)                 result = (input[0] &gt;= '0'                 || input[0] &lt;= '9') ? (result                 * 10) + input[0] - '0' + (((input                 = input.Remove(0, 1)).Length                 &gt; 0) ? 0 : 0) : 0;             return result;         }          \/\/ Test Data         static HabrDataRow[] testData = new HabrDataRow[]         {             #region Data             new HabrDataRow()             {                  Input    = &quot;0&quot;,                  Expected = 0,                  ExpectedException = null,                  Comment = &quot;\u0413\u0440\u0430\u043d\u0438\u0447\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435&quot;,             },             new HabrDataRow()             {                  Input    = &quot;1&quot;,                  Expected = 1,                  ExpectedException = null,                  Comment = &quot;\u0413\u0440\u0430\u043d\u0438\u0447\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435&quot;,             },             new HabrDataRow()             {                  Input    = &quot;-1&quot;,                  Expected = -1,                  ExpectedException = null,                  Comment = &quot;\u0413\u0440\u0430\u043d\u0438\u0447\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435&quot;,             },              new HabrDataRow()             {                  Input    = &quot;2147483647&quot;,                  Expected = 2147483647,                  ExpectedException = null,                  Comment = &quot;int.MaxValue&quot;,             },             #endregion         };          \/\/ Data Generator         public override HabrDataRow GetNextDataRow(int rowIndex)         {             return testData[rowIndex];         }          \/\/ Test Implementation         public override void TestMethod(HabrDataRow dataRow, int rowIndex)         {             int actualResult = ConvertToNumber(dataRow.Input);             Assert.AreEqual(dataRow.Expected, actualResult);         }     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c \u0442\u0430\u043a\u0438\u043c \u0438\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u043c \u043c\u0430\u043d\u0435\u0432\u0440\u043e\u043c, \u043c\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043f\u0430\u0432\u0448\u0438\u0439 \u0442\u0435\u0441\u0442.<br \/>  <a href=\"http:\/\/1.bp.blogspot.com\/-w3Surcyh0hM\/UikjTrb9waI\/AAAAAAAADQ0\/lrL4ilK0V4Y\/s1600\/insane-test-results-large.png\"><img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/7b2\/59c\/ba9\/7b259cba94d95172a9606b390b47f078.png\" alt=\"image\"\/><\/a><\/p>\n<h4>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u0441\u0441\u044b\u043b\u043a\u0438<\/h4>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/dzhariy\/mstest-rows\">Github \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/dzhariy\/mstest-rows\/tree\/master\/habrahabr-article\">\u041a\u043e\u0434 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430<\/a><\/li>\n<\/ul>\n<p>  <b>\u0414\u0440\u0443\u0433\u0438\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b \u043f\u043e \u0442\u0435\u043c\u0435:<\/b>  <\/p>\n<ul>\n<li><a href=\"http:\/\/codeclimber.net.nz\/archive\/2008\/01\/18\/How-to-simulate-RowTest-with-MS-Test.aspx\">How to simulate RowTest with MS Test<\/a><\/li>\n<li><a href=\"http:\/\/blog.drorhelper.com\/2011\/09\/enabling-parameterized-tests-in-mstest.html\">Enabling parameterized tests in MSTest using PostSharp<\/a><\/li>\n<li><a href=\"http:\/\/neimke.blogspot.com\/2011\/03\/mstest-data-driven-tests-using-excel.html\">MSTest data driven tests \u2014 Using Excel 2007 as a data source<\/a><\/li>\n<li><a href=\"http:\/\/haydenking.co\/blog\/2013\/03\/14\/nunit-v-mstest-parameterized-tests\/\">NUnit vs. MSTest: Parameterized Tests<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<hr\/>\n<p>  <b>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 1:<\/b> \u0412 \u0444\u0430\u0439\u043b\u0435 TestRows.cs \u2013 30 000 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430. \u0415\u0441\u043b\u0438 \u0432\u0430\u0448 \u0437\u0430\u0440\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u0431\u043e\u043d\u0443\u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430, \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430\u0447\u0438\u0441\u043b\u0438\u0442 \u0432\u0430\u043c \u0431\u043e\u043d\u0443\u0441 \u0432 \u0440\u0430\u0437\u043c\u0435\u0440\u0435 1 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u0430 \u0434\u043e\u043b\u043b\u0430\u0440\u043e\u0432, \u0442\u043e \u044f \u0434\u0443\u043c\u0430\u044e, \u0431\u0443\u0434\u0435\u0442 \u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0432\u044b\u0448\u043b\u0435\u0442\u0435 \u043c\u043d\u0435 \u0445\u043e\u0442\u044f \u0431\u044b 5% \u043e\u0442 \u044d\u0442\u043e\u0439 \u0441\u0443\u043c\u043c\u044b. <\/p>\n<p>  <b>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 2:<\/b> \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c ConvertToNumber \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043b \u0432\u0441\u0435 \u0442\u0435\u0441\u0442\u044b. <br \/>  \u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u201c\u0430\u0432\u0442\u043e\u0440\u0441\u043a\u043e\u0433\u043e \u0441\u0442\u0438\u043b\u044f\u201d.    \t<\/p>\n<div class=\"clear\"><\/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=\"http:\/\/habrahabr.ru\/post\/192720\/\"> http:\/\/habrahabr.ru\/post\/192720\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/256\/734\/927\/2567349277b1c1f5ce36cafabcfbd482.png\" align=\"right\"\/>\u042f \u0431\u044b \u0441\u0440\u0430\u0437\u0443 \u0445\u043e\u0442\u0435\u043b \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u044c \u0442\u043e\u0442 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u043c\u0438\u0440 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u043c\u0438\u0440 \u043f\u0440\u0438\u0451\u043c\u043e\u0447\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u2013 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u043c\u0438\u0440\u044b: \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u0437\u0430\u043a\u043e\u043d\u0430\u043c\u0438, \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438. \u0418 \u0435\u0441\u043b\u0438 \u043c\u0438\u0440 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0432 \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u0438, \u0442\u043e \u0442\u0435\u0441\u0442\u044b \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u2013 \u044d\u0442\u043e \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439, \u043f\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043a\u043d\u043e\u043f\u043e\u043a \u0438 \u043d\u0430\u0431\u043e\u0440 \u0442\u0435\u043a\u0441\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u0438\u0442\u043e\u0433\u0435 \u0441\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0431\u043e\u043b\u0435\u0435 \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u0431\u0438\u0437\u043d\u0435\u0441-\u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438. <\/p>\n<p>  \u041d\u0435 \u0440\u0435\u0434\u043a\u043e \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a, \u0447\u0442\u043e \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u2013 \u0442\u043e \u044d\u0442\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u044b \u0434\u043b\u044f UI-\u0442\u0435\u0441\u0442\u043e\u0432. <\/p>\n<p>  \u0422\u0430\u043a \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0438 \u0432 \u043c\u043e\u0435\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435, \u043a\u043e\u0433\u0434\u0430 \u044f \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c data-driven \u0442\u0435\u0441\u0442\u044b \u0432 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 Ms-Test. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u043e\u043f\u0438\u0448\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0438 \u0441\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043d\u0435 \u043f\u043e\u0439\u043c\u0443 \u2013 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0433\u043e\u0440\u0434\u0438\u0442\u044c\u0441\u044f \u0438\u043b\u0438 \u0441\u0442\u044b\u0434\u0438\u0442\u044c\u0441\u044f.   <\/p>\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-192720","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/192720","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=192720"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/192720\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=192720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=192720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=192720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}