Personalized Community is here!
Quickly customize your community to find the content you seek.
Check out the latest Business Central updates!Learn about the key capabilities and features of Dynamics 365 Business Central and experience some of the new features.
Download overview guide | Watch Business Central video
2021 Release Wave 1Discover the latest updates and new features to Dynamics 365 planned April 2021 through September 2021.
Release overview guides and videos Release Plan | Preview 2021 Release Wave 1 Timeline
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
Let´s make a reminder about TDD (Test Driven Development). The TDD principles tell that you must design based in test, and this means:
The TDD principles are resumed in acronym F.I.R.S.T.:
Well we are talking too much about TDD in a non TDD post. Please, if you aren´t familiar with TDD, you can follow this user https://dynamicsuser.net/nav/b/vanvugt.
Before explain TDD and unit test, could be good to take a short look at what must do the test code:
And very important, all these steps must be automated, even the assert. So, we can define:
For the same reason that we make production code: save time. Test code could be a product itself instead of being part of a methodology.
TDD is the better way to do quality software. But not all the people use TDD. And not all the software we do is quality software. But even if you don´t do TDD you could propose use test code.
Let´s see tree real cases using unit test without TDD.
We bought a specific Navision software from other vendor.
This module is a legal modification that gets sales invoice headers, and create an XML file for a tax office declaration.
Test other vendor isn´t our responsibility. But we did a very simple test code to do:
Assert.AreEqual(SalesInvoiceHeader."VAT Registration No.",LibraryXMLRead.GetNodeValueInSubtree('VatRegNode','VatRegNo'),ErrFieldXML);
Assert.AreEqual(SalesInvoiceHeader.Amount, AmountInFile, ErrFieldXML);
We used two existing test Codeunits in NAV test toolkit:
LibraryXMLRead Codeunit Library - XML Read
Assert Codeunit Assert
We said test other vendor code not our responsibility, but we did a little test. Why? Two good reasons:
Business Applications communities