How to assert record count is zero for testPart

markclemarkcle 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
//[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

Answers

Sign In or Register to comment.