{"id":1355,"date":"2023-05-31T17:42:03","date_gmt":"2023-05-31T09:42:03","guid":{"rendered":"https:\/\/www.mustenaka.cn\/?p=1355"},"modified":"2023-05-31T18:00:22","modified_gmt":"2023-05-31T10:00:22","slug":"unity-nunitlake","status":"publish","type":"post","link":"https:\/\/www.mustenaka.cn\/index.php\/2023\/05\/31\/unity-nunitlake\/","title":{"rendered":"Unity NUnit\u7f3a\u5931"},"content":{"rendered":"<h3>Unity NUnit\u7f3a\u5931<\/h3>\n<p>Unity\uff0c\u4e43\u81f3C#\uff0c\u90fd\u9700\u8981\u7f16\u5199\u5355\u5143\u6d4b\u8bd5\u8fdb\u884c\u6d4b\u8bd5\u5f00\u53d1\uff0c\u53c8\u6216\u8005\u63a5\u6536\u522b\u4eba\u7684\u5f00\u53d1\u5305\uff08\u6bd4\u5982\u8bf4litjson\uff09\uff0c\u5176\u4e2d\u81ea\u5e26\u4e86NUnit.Framework\u7684\u5f15\u7528\uff0c\u5374\u603b\u662f\u89e6\u53d1\u62a5\u9519\uff0c\u8bf4\u6ca1\u6709\u627e\u5230NUnit\u3002<\/p>\n<h3>C#\u73af\u5883\u7684NUnit<\/h3>\n<p>\u7f51\u4e0a\u5927\u591a\u6570\u7684\u6559\u7a0b\u90fd\u662f\u5efa\u8bae\u4f60\u4f7f\u7528NuGet\u5305\u7ba1\u7406\u5de5\u5177\uff08\u65e0\u8bba\u662fVisual Studio\u8fd8\u662fRider\uff09\uff0c\u5c06NUnit\u5b89\u88c5\u5230\u9879\u76ee\u4e2d\uff0c\u4e8b\u5b9e\u4e0a\uff0c\u8fd9\u4e2a\u64cd\u4f5c\u4e00\u822c\u9488\u5bf9\u72ec\u7acb\u7684C#\u9879\u76ee\uff08\u6216\u8005\u4f9d\u8d56.net\u73af\u5883\u7684\u9879\u76ee\uff09\u4f7f\u7528\u3002\u800c\u5bf9Unity3D\u65e0\u6548\u3002<\/p>\n<h3>Unity\u7684Unit<\/h3>\n<p>\u901a\u8fc7\u5b98\u65b9\u9875\u9762\uff1a<a href=\"https:\/\/docs.unity3d.com\/cn\/2019.2\/Manual\/com.unity.ext.nunit.html\">https:\/\/docs.unity3d.com\/cn\/2019.2\/Manual\/com.unity.ext.nunit.html<\/a><\/p>\n<p>\u53ef\u4ee5\u5f97\u77e5Unity\u5b98\u65b9\u5c01\u88c5\u4e86\u4e00\u4e2a<span>\u81ea\u5b9a\u4e49\u7248\u672c\u7684 NUnit \u5305\uff0c\u53ef\u4e0e Unity \u7ed3\u5408\u4f7f\u7528\u3002\u7531 Unity Test Framework \u4f7f\u7528\uff0c\u5982\u679c\u540c\u65f6\u5728Unity\u5b89\u88c5\u4e86NUnit\u548cNuGet\u7684NUit\uff0c\u4f1a\u6700\u7ec8\u4ee5Unity\u4e2d\u7684\u4e3a\u51c6\u3002<\/span><\/p>\n<h3>\u4e00\u4e2aBUG<\/h3>\n<p><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/www.mustenaka.cn\/wp-content\/uploads\/2023\/05\/40168e4ef6ac90bdea36770f4bc72682-300x225.png\" alt=\"\" width=\"479\" height=\"359\" class=\" wp-image-1359 aligncenter\" srcset=\"https:\/\/www.mustenaka.cn\/wp-content\/uploads\/2023\/05\/40168e4ef6ac90bdea36770f4bc72682-300x225.png 300w, https:\/\/www.mustenaka.cn\/wp-content\/uploads\/2023\/05\/40168e4ef6ac90bdea36770f4bc72682-1024x769.png 1024w, https:\/\/www.mustenaka.cn\/wp-content\/uploads\/2023\/05\/40168e4ef6ac90bdea36770f4bc72682-768x577.png 768w, https:\/\/www.mustenaka.cn\/wp-content\/uploads\/2023\/05\/40168e4ef6ac90bdea36770f4bc72682-1536x1154.png 1536w, https:\/\/www.mustenaka.cn\/wp-content\/uploads\/2023\/05\/40168e4ef6ac90bdea36770f4bc72682.png 1600w\" sizes=\"(max-width: 479px) 100vw, 479px\" \/><\/p>\n<p>\u5f53\u6211\u4eec\u6253\u5f00Unity\u7684Window &#8211; Package Manager\u7684\u65f6\u5019\uff0c\u4f1a\u53d1\u73b0NUnit\uff08\u540d\u79f0\u4e3a\uff1aCustom NUnit\uff09\u5df2\u7ecf\u5b89\u88c5\u4e86\uff0c\u5b9e\u9645\u4e0a\uff0c\u5e76\u6ca1\u6709\u6210\u529f\u52a0\u8f7d\u8fdb\u5165\u9879\u76ee\uff08\u8fd9\u53ef\u80fd\u662f\u4e00\u4e2aBUG\uff09\uff0c\u5bfc\u81f4\u5b9e\u9645\u4e0a\u7684NUnit\u5e76\u6ca1\u529e\u6cd5\u4f7f\u7528\u3002<\/p>\n<p>\u9700\u8981\u624b\u52a8\u70b9\u51fbPackage Manager\uff0c\u5de6\u4e0a\u89d2\u7684\u2018+\u2019\u53f7\uff0c\u7136\u540e\u9009\u62e9 Add package from git URL\uff0c\u8f93\u5165<a href=\"https:\/\/github.com\/nunit\/docs\/wiki\/NUnit-Documentation\" target=\"_blank\" rel=\"noopener\">com.unity.ext.nunit<\/a>\u624b\u52a8\u6dfb\u52a0NUnit\u5230Unity\u4e2d\uff0c\u6b64\u65f6\u4f1a\u53d1\u73b0\uff0c\u6210\u529f\u5b89\u88c5\u4e86\u4e5f\u6ca1\u6709\u4efb\u4f55\u53d8\u5316\uff0c\u4ee3\u7801\u7f16\u8f91\u5668\u8fd8\u662f\u4f1a\u62a5\u9519\u3002<\/p>\n<p>\u6700\u540e\u9700\u8981\u5173\u95ed\u4ee3\u7801\u7f16\u8f91\u5668\uff08\u5237\u65b0\u6216\u8005\u91cd\u542f\uff09\uff0c\u5373\u53ef\u53d1\u73b0NUnit\u73af\u5883\u4e0d\u518d\u62a5\u9519\uff0c\u53ef\u4ee5\u6b63\u5e38\u4f7f\u7528\u5355\u5143\u6d4b\u8bd5\u3002<\/p>\n<h3>\u9644<\/h3>\n<p>\u5355\u5143\u6d4b\u8bd5\u7684\u5185\u5bb9\u5982\u679c\u8f83\u591a\uff0c\u5efa\u8bae\u7ed9\u7f16\u8f91\u5668\u6253\u4e00\u4e2a\u63d2\u4ef6\uff0c\u5982VS\u4e2d\u53ef\u4ee5\u6309\u4f4f\u554a\u4e2aAssembly Explorer\uff0c\u5728\u62d3\u5c55\u4e2d\u5b89\u88c5NUnit\u76f8\u5173\u7684\u63d2\u4ef6\uff0c\u8ba9\u5355\u5143\u6d4b\u8bd5\u66f4\u52a0\u76f4\u89c2\u5904\u7406\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>PS\uff1a\u8fd9\u4e2abug\u597d\u5751\u554a\uff0c\u5728\u8fd9\u4e48\u7284\u89d2\u65ee\u65ef\u7684\u5730\u65b9\u6709\u8fd9\u4e2a\u95ee\u9898\uff0c\u641e\u5f97\u5bfc\u51fa\u5e26NUnit\u7684\u5305\u5168\u90e8\u90fd\u6709\u8fd9\u95ee\u9898\uff0c\u522b\u4eba\u63a5\u624b\u4e4b\u540e\u4e00\u65f6\u534a\u4f1a\u53c8\u6ca1\u6cd5\u89e3\u51b3\uff0c\u5f97\u6211\u4e3b\u52a8\u53bb\u548c\u4ed6\u8bf4\u89e3\u51b3\u529e\u6cd5\u3002<\/p>\n<p>\u80fd\u4e0d\u80fd\u901a\u8fc7\u4ee3\u7801\u7684\u65b9\u5f0f\uff0c\u81ea\u52a8\u68c0\u67e5\u5e76\u4e14\u8981\u6c42\u4f7f\u7528unpackage\u7684\u7528\u6237\u5b89\u88c5NUnit\uff0c\u540c\u7406\u6bd4\u5982ecs\u7b49\u8fd9\u4e9b\u6a21\u5757\uff0c\u4e5f\u6709\u8fd9\u79cd\u95ee\u9898\u7684\uff0c\u80fd\u5426\u6709\u81ea\u52a8\u5316\u5904\u7406\u65b9\u6cd5\uff0c\u50cf\u5199java\u9879\u76eemaven\u90a3\u6837\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Unity NUnit\u7f3a\u5931 Unity\uff0c\u4e43\u81f3C#\uff0c\u90fd\u9700\u8981\u7f16\u5199\u5355\u5143\u6d4b\u8bd5\u8fdb\u884c\u6d4b\u8bd5\u5f00\u53d1\uff0c\u53c8\u6216\u8005\u63a5\u6536\u522b\u4eba\u7684\u5f00 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[118],"tags":[116],"class_list":["post-1355","post","type-post","status-publish","format-standard","hentry","category-unity3d","tag-unity3d"],"views":1621,"_links":{"self":[{"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/posts\/1355","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1355"}],"version-history":[{"count":5,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/posts\/1355\/revisions"}],"predecessor-version":[{"id":1361,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/posts\/1355\/revisions\/1361"}],"wp:attachment":[{"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1355"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1355"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mustenaka.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}