How to assert record count is zero for testPart

markcle
Member Posts: 65
Hi All
Using BC 13 on-prem. I'm an end user writing test (so no dev license or test libs or access to Application Test Toolkit)
I need to write a test using a test part that checks that there no records matching a filter.
Use case is, user changes ship method to FLOC, the extension inserts a freight line with item FLOC, but it also has to delete any freight lines that match item 'FCOM | FJOB | FRES | FLIFT'
So I'm trying to write a test to assert that a filter on the TestPart returns zero records. Only assertions I seem to have available to me are asserterror and .Assertequals. I tried this
No luck. How can I assert that the record count is zero?
Thanks
Mark
Using BC 13 on-prem. I'm an end user writing test (so no dev license or test libs or access to Application Test Toolkit)
I need to write a test using a test part that checks that there no records matching a filter.
Use case is, user changes ship method to FLOC, the extension inserts a freight line with item FLOC, but it also has to delete any freight lines that match item 'FCOM | FJOB | FRES | FLIFT'
So I'm trying to write a test to assert that a filter on the TestPart returns zero records. Only assertions I seem to have available to me are asserterror and .Assertequals. I tried this
//[THEN] There should be no sales lines of type FCOM, FJOB, FRES, FLIFT SalesLines.Filter.SetFilter("Document Type", '1'); SalesLines.Filter.SetFilter(Type, '2'); SalesLines.Filter.SetFilter("No.", 'FCOM | FJOB | FRES | FLIFT'); SalesLines.First().AssertEquals.False ;
No luck. How can I assert that the record count is zero?
Thanks
Mark
0
Answers
-
-
can you use IsEmpty?
Thanks for suggestion. no luck. Only methods i have are these:
https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/testpart/testpart-data-type0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions