Test logic troubleshooting
Capturing more complicated test logic within automated testing might be tricky. If you encounter difficulty, try following the tips below.
- Clearly state to yourself what data you are trying to test, and write it out naturally. Make sure to include what would count as a passing or failing result! - Example: “It’s important that all of our organization’s IT admins stay up-to-date on all training assigned to them. To test this, I want to make sure that all training assigned to IT admins has Auto enroll turned on, and the completion percentage is at least 90%.” 
- Break down your case into its base logic. - Example: “I only want this test to apply to training campaigns that include IT admins. If it doesn’t apply to IT admins, I want to ignore it in this test. If a campaign that includes IT admins has Auto enroll turned off, then this test should fail. This test should also fail if a campaign that includes IT admins has a completion percentage less than 90%.” 
If you’re familiar with formal logic, you may also find it helpful to write it out formally.
Example: IF ((Group CONTAINS "IT Admin" AND Auto-Enroll IS FALSE) OR (Group CONTAINS "IT Admin" AND Auto-Enroll IS FALSE) THEN Test FAILED
Translate your logic into proof.
- Remember, Add another condition equates to a logical AND and + New test case equates to a logical OR. 
- If you’re still having trouble, consider flipping the Pass/Fail logic. Depending on your context, something like Completion Percentage < 90 THEN Fail might make more sense than Completion Percentage >= 90 THEN Pass.