by Unknown user
Having dealt with most of the messy UI code, I'm ready for some clean, efficient, highly rational business logic. This is work I usually do in unit tests. And the first thing I need is a unit test app, one that will run with my ClarionTest unit testing framework.
...
My baseline class uses the CML conventions, and is included in CML as CML_BaseClass.inc and CML_BaseClass.clw.
The first unit test
The TXA created a sample unit test procedure for me. But what will my first unit test be?
...
Step two is to get a clean compile ( and a failed test).. If the test doesn't fail at this stage then it's clearly not a good test!
I do have an empty class on hand, so I need to include that globally:
...
So far so good. But can I wire this into my UITest program?
Using the tested class
My UITest program used this queue declaration:
...
Code Block |
---|
ManyToMany.SetLinkTo(RightRecordX) ManyToMany.SetLinkTo(RightRecordZ) AssertThat(ManyToMany.IsLinkedTo(RightRecordX),IsEqualTo(true), 'Test 1 failed') AssertThat(ManyToMany.IsLinkedTo(RightRecordY),IsEqualTo(false),'Test 2 failed') AssertThat(ManyToMany.IsLinkedTo(RightRecordZ),IsEqualTo(true), 'Test 3 failed') |