VBA ã®ã¦ããããã¹ã
ã¡ãã£ã¨ Excel VBA ã§ã¦ããããã¹ãããããªã£ãã®ã§ãã©ããªãã¼ã«ï¼ã©ã¤ãã©ãªãããã調ã¹ã¦ã¿ã¾ããã
ï¼2014/12/10 追è¨ï¼
以ä¸ã®ãã¼ã¸ã®ã»ããæ
å ±ãå¤ãï¼æ°ããã®ã§ããã¡ããè¦ã¦ããã ããã»ããããããã§ãã
ï¼2014/12/10 追è¨ããã¾ã§ï¼
VBAUnit
xUnit ã£ã½ãä½ã£ã¦ãããããã§ãã
åé¡ã¯ããã¸ã§ã¯ãã«ãã¹ãç¨ã®ã¯ã©ã¹ã大éã«èªã¿è¾¼ã¾ãªãã¨ãããªããã¨ã
ãããªæãã§ãå®éã«ãã¹ããããã¯ã©ã¹ãã©ãã«ãããããããªããªã£ã¦ãã¾ãããã§ãã
ã¾ããVB Lite Unit ã§ææããã¦ããããã«ããã¹ã対象ã®ã¡ã½ãããåè¨ããã®ãé¢åããã§ãã
VB Lite Unit
ãã¡ã㯠regsvr32 㧠ActiveX ã³ã³ãã¼ãã³ããç»é²ãã¦å©ç¨ããå½¢ãVBAUnit ã¿ããã«ããã¸ã§ã¯ããæ±ããªãã¦ããã§ããã¾ãã
This simple, solid design works well in VB/VBA, doesn't attempt introspection, and doesn't require lists of test methods outside of the test code.
ã¨ã®ãã¨ã§ããã¹ãã±ã¼ã¹ã®ä¸è¦§ãæ¸ããªãã¦ãããã¨ã®ãã¨ã§ããï¼ä¸ã¤ã®ã¡ã½ããã«ãã£ã¡ãããã¹ããæ¸ãæ¹éã ãããªãã§ããã©ãã»ã»ã»ãï¼
ã㨠GUI ã§è²ã¤ãã§çµæãåºãã®ã§ããããããæ°ããã¾ãã
æ¬ ç¹ã¯ã使ãæ¹ããããã«ãããã¨ã§ããããã®ããã°è¦ã¦ãããããããã¾ããã
- VB Lite Unitをインストールしてみる。 - FFsPaMs 平田敦のコンピュータ・書評・お仕事の記録 - Yahoo!ブログ
- VB Lite Unit やっと「起動のしかた」を理解した - FFsPaMs 平田敦のコンピュータ・書評・お仕事の記録 - Yahoo!ブログ
ã¤ããã£ã¨ã¤ãã¦ã£ã³ãã¦ã§ã¯ã©ã¹ã New ãã¦å®è¡ã¨ã»ã»ã»ã確ãã«ããè¦ãã¨ããã¸ã§ã¯ããã¼ã¸ã§ãã¤ããã£ã¨ã¤ãã¦ã£ã³ãã¦ã«æ¸ãã¦ãããã©ãReadme èªãã ã ãã§ã¯ãããã¾ããã§ããã»ã»ã»ãï¼è¿½è¨: é©å½ãª Public Sub ãä½ã£ã¦ããããåãããã«å¼ã³åºãã¦ã大ä¸å¤«ã ã¨æãã¾ãã念ã®ãããï¼
Excel ã§è©¦ãã«å®è¡ãããå ´åã¯ä¸è¨ããã°ãåèã«ã¤ã³ã¹ãã¼ã«ããå¾ã
- é©å½ã«ã¯ã¼ã¯ããã¯ãä½ã
- åç §è¨å®ã§ VbLiteUnit ãæå¹ã«ãã
- vb-lite-unit-1.2.5-demo-txt.zip ä¸ã«å«ã¾ãã .cls ã¨å ¨é¨åãè¾¼ãï¼ããã¸ã§ã¯ãã¨ã¯ã¹ããã¼ã©ã« D&Dï¼
- ã¤ããã£ã¨ã¤ãã¦ã£ã³ãã¦ã§ä»¥ä¸ãå®è¡ãã
RunTests New tclsTestClauseText
ã¨ãããããªæé ã§è©¦ããã¨æãã¾ããï¼ã¡ãªã¿ã« vb-lite-unit-1.2.5-demo-a2k.zip 㯠Access 2000 ç¨ã®ãã¢ã¿ããã§ããï¼
Visual Basic Editor ã®ã¤ã¡ã¼ã¸ã¯ãããªã
VBAUnit ã«æ¯ã¹ãã¨ããã¸ã§ã¯ãããã£ãããã¦ãï¼å®è¡ã®ä»çµã¿ãã·ã³ãã«ãªã®ããããã¨æãã¾ãã
xlUnit
ã§å ¬éããã¦ããæ¯è¼çæ°ãããã¼ã«ã®ããã§ãã
ããã¥ã¡ã³ãããã¾ãç¡ããã§ããã©ã
ã«è§£èª¬åç»ãä¸ãã£ã¦ããã®ã§ããããè¦ãã¨ããããã§ãã
åç»ã®å 容ãé©å½ã«å·®ãè¾¼ã¿ã¤ã¤èª¬æããã¨ä»¥ä¸ã®ãããªæãã
- xlUnit ã¯ã¢ãã¤ã³ã§å°å
¥ããå½¢
- %APPDATA%\Microsoft\AddIns ã«ç½®ãã¦ãããã¢ãã¤ã³ãæå¹åãã㨠xlUnit ã¡ãã¥ã¼ã追å ããã
- ããã¼ã«ãâããã¯ããâãã»ãã¥ãªãã£ãâãä¿¡é ¼ã§ããçºè¡å ãâãVisual Basic ããã¸ã§ã¯ãã¸ã®ã¢ã¯ã»ã¹ãä¿¡é ¼ãããã«ããå¿ è¦ãããã¨ããªãã¨ã
- ãã¹ã対象ã®ã¯ã©ã¹ãããã¯ã¼ã¯ããã¯ã¨ã¯å¥ã«ãã¹ãç¨ã®å¥ã® workbook ãä½ãå½¢
- ãã®ã¯ã¼ã¯ããã¯ã¯ xlUnit ãä½ã
- åç»ã§ã使ããã¦ã Making Excel Apps Testable ≪ Grumpy Old Programmer ã®å³ããããããã
- ãã以å¤ã«ã このブログの xlunit タグ ãè¦ãã¨ããã¤ãæ å ±ãããã®ã§ãç»é¢ã¤ã¡ã¼ã¸ããã¡ããè¦ãã¨ãããã¨
- xlUnit ã¡ãã¥ã¼ããããããæä½ãè¡ã
- ãã¹ã対象ã¨ãªãã¢ããªã±ã¼ã·ã§ã³ã¨ãã¹ãç¨ã®ã¯ã¼ã¯ããã¯ãä½ã
- ãã¹ã対象ã¨ãªãã¯ã©ã¹ã追å ãã
- ãã¹ãã³ã¼ãã®éå½¢ãã§ããã®ã§ãTestCase_Run ã« mR.AssertXxxxx ã使ã£ã¦ãã¹ããæ¸ã
- ãã®éãã¹ã対象ã®ãªãã¸ã§ã¯ãã¯ãã¹ã対象ã¢ããªã±ã¼ã·ã§ã³ã® Factory çµç±ã§åå¾ããï¼ã¡ããã¨ç解ãã¦ãªããã©ãããããªãã¨ã¨ã©ã¼ã«ãªãï¼
- Alt+F8 㧠doTests ãå®è¡ãã㨠TestReport ã·ã¼ãã«çµæãåºåããã
Visual Basic Editor ã§ã®ã¤ã¡ã¼ã¸ã¯ãããªæãã§ãã
xUnit ã«è¿ãã¦æªããªãããããªããã¨ã
ã¡ãªã¿ã«ãã¯ãã使ã£ã¦ãã¹ã対象ï¼ãã¹ãã®ã¯ã¼ã¯ããã¯ãã»ããã§ä½ãã®ãåºæ¬çãªä½¿ãæ¹ã¿ããã§ãæ¢åã® Excel VBA ã®ãã¹ãããããã¨ãããã§ããã©ãçµå±ãã¾ãããã¾ããã§ãããï¼ããããã¯ããã ãããã©æéåãï¼
ã㨠LOCutus.xls ã£ã¦ããã³ã¼ãã¡ããªã¯ã¹ãã¼ã«ãå ¥ã£ã¦ãã¿ããã§ããããªã¡ããªã¯ã¹ãè¦ããã¨ãã§ãã¾ãã
ããä»å¾æ¬æ ¼çã« Excel VBA ã使ãã¨ããã xlUnit ããããããªæ°ããã¦ãã¾ãã
- VBAUnit 㯠Debug.Print ãã¦ãå½¢
- VB Lite Unit ã¯ãã©ã¼ã ã«åºåããå½¢
ãªã®ã§ãã¹ãçµæãæ¾ãã«ãããã©ããã㯠OLE ã¨ã使ã£ã¦é¢æ°å©ãã¦ã»ã«ã®å¤ãæ¾ãã ãã§ããã®ã§ CI ã«ãçµã¿è¾¼ã¿ããããã§ããã