Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
.Automated Testing in Microsoft Dynamics 365 Business Central

You're reading from   .Automated Testing in Microsoft Dynamics 365 Business Central Efficiently automate test cases in Dynamics NAV and Business Central

Arrow left icon
Product type Paperback
Published in Apr 2019
Publisher Packt
ISBN-13 9781789804935
Length 222 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Luc van Vugt Luc van Vugt
Author Profile Icon Luc van Vugt
Luc van Vugt
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Section 1: Automated Testing - A General Overview FREE CHAPTER
2. Introduction to Automated Testing 3. Section 2: Automated Testing in Microsoft Dynamics 365 Business Central
4. The Testability Framework 5. The Test Tool and Standard Tests 6. Section 3: Designing and Building Automated Tests for Microsoft Dynamics 365 Business Central
7. Test Design 8. From Customer Wish to Test Automation - The Basics 9. From Customer Wish to Test Automation - Next Level 10. From Customer Wish to Test Automation - And Some More 11. Section 4: Integrating Automated Tests in Your Daily Development Practice
12. How to Integrate Test Automation in Daily Development Practice 13. Getting Business Central Standard Tests Working on Your Code 14. Test-Driven Development 15. Setting Up VS Code and Using the GitHub Project 16. Other Books You May Enjoy

Making your code testable

We were looking at getting standard tests fixed and we did. But at the same time we did overlook that fixing them made a pair of our own tests fall over. Do you see?

We have two failing tests and in the same codeunit LookupValue Posting:

  • PostSalesOrderWithNoLookupValue
  • PostWarehouseShipmentFromSalesOrderWithNoLookupValue

This is their error text:

Microsoft.Dynamics.Nav.Types.Exceptions.NavNCLAssertErrorException: An error was expected inside an ASSERTERROR statement.\   at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.AssertError(Action body)\   at Microsoft.Dynamics.Nav.BusinessApplication.C

Without debugging, this information already tells me a whole story. This is confirmed by the code of the first test method:

procedure PostSalesOrderWithNoLookupValue();
//[FEATURE] LookupValue Posting Sales Document
var
SalesHeader: Record "Sales Header...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime