Chapter 12: Writing Testable Code
So far, in this book, our focus has been on writing test code. The LookupValue extension, our example case, came with application code mainly ready. As such we did not talk about how to get your application code better suited to being tested. We did not ask ourselves: what does it mean to write testable code?
In this chapter, we'll find an answer to this query based on the following questions:
- What is testable code?
- How to make your code testable?
As we have done in the previous chapters, we will go through a test example, Test example 11 – how to unit test event subscribers' logic, where we'll work out one of the techniques discussed.
Technical requirements
Like in the previous chapter, we will refer to ...
Get Automated Testing in Microsoft Dynamics 365 Business Central - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.