Tag unit test

ความแตกต่างของ Unit Test และ Integration Test

Unit Test คือ การทดสอบ Code ในส่วนที่เล็กที่สุดของ Developer เพื่อทดสอบว่าสิ่งที่เขียนมามันใช้ได้จริงนะ และมี Test ตามที่ผู้พัฒนาเห็นว่ามันสำคัญ (พยายามทำให้ได้เยอะที่สุดครับ) Test ควรทำได้ง่าย เขียนสั้น และกระชับ เพราะกลุ่มคนหลักๆที่ใช้ คือ ตัว Developer เองครับ สิ่งที่เป็นหัวใจหลักของ Unit Test คือ ทำให้มันอยู่ได้ด้วยตัวมันเอง ไม่มี Dependency ไปยุ่งกับ Code ตัวอื่นๆ ถ้าจำเป็นต้องใช้จริงๆ ให้ Mock มันเข้ามาให้หมด เพราะจุดประสงค์ของ Unit Test ดูเฉพาะ Logic การทำงานในส่วนที่เราสนใจจริงๆ…

[.NET] Failed to initialize client proxy: could not connect to test process vstest.discoveryengine.x86.exe

เพิ่มเติมจากบทความเมื่อวานนะครับ Failed to initialize client proxy: could not connect to test process. แต่คราวนี้ตัว Visual Studio มีการแจ้ง Message เพิ่มเติมจากครั้งที่แล้ว ดังนี้ครับ —— Run test started —— Failed to initialize client proxy: could not connect to test process vstest.discoveryengine.x86.exe ========== Run test finished: 0…

[.NET] Failed to initialize client proxy: could not connect to test process.

—— Run test started —— Failed to initialize client proxy: could not connect to test process. ========== Run test finished: 0 run (0:01:32.44) ========== พอดีจะ Test Code ที่พัฒนาขึนมา แล้วเจอปัญหานี้ขึ้น และคงอารมณ์เสียไปตามๆกัน กว่าจะรอมัน Discover Test เสร็จ เวลา Test ดันมาจากเจอปัญหานี้ได้ โดยทางแก้ไข ผมได้ไปสืบเสาะหาจาก Google…