# 10.Mock Framework

💬 ในบางครั้งที่เราเขียนเทส เราอาจจะไปเกี่ยวข้องกับงานส่วนอื่นๆที่เราไม่สนใจก็ได้ ซึ่งในหลายๆครั้งงานส่วนที่ไม่เกี่ยวข้องพวกนั้นก็เป็นอุปสรรค์ในการเขียนเทสของเราก็ได้ ดังนั้นในรอบนี้เราจะมาทำความรู้จักกับสิ่งที่เรียกว่า Mock framework ที่จะเข้ามาช่วยจัดการกับงานส่วนอื่นๆที่เราไม่ได้สนใจมันนะครับ

{% embed url="<https://www.youtube.com/watch?v=HD36K9HoTeo&list=PLUjAn8nwWniiL3ToFK8PfmAo8U6IoGAkg&index=12>" %}

## 🎯 สรุปสั้นๆ

### 👨‍🚀 Mock framework

เป็นตัวช่วยในการจัดการกับงานส่วนอื่นๆที่เราไม่ได้สนใจ หรือ เป็นงานส่วนที่เราต้องการให้มันได้รับผลลัพท์แบบต่างๆที่เหมาะสมกับ test cases ของเรา ซึ่งเจ้า mock framework จะเข้าไปจำลองงานส่วนนั้นให้เรา แทนที่เราจะไปเรียกใช้โค้ดส่วนนั้นจริงๆนั่นเอง


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.saladpuk.com/software-testing/tdd101/mock-framework.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
