I'll try to make my question as simple as possible.
Context
Create an array that holds numbers; given the following constraints:
- Each number should not be a duplicate of an already existing number.
- Each number should not start with an even digit.
Question
Should each test case focus on a single behavior and assert whether this behavior conforms with all constraints (Multiple Assertion), or should each test case focus on a single behavior and a single constraint assertion?
Mock-Up
class UnitTest():
def MultipleAssertions(self):
#logic to add number into array
#assertion on first constraint (duplication)
#assertion on the second constraint (even digit)
def FirstSingleAssertion(self):
#logic to add number into array
#assertion on first constraint (duplication)
def SecondSingleAssertion(self):
#logic to add number into array
#assertion on second constraint (even digit)
Knowing that each test case should solely focus on a single behavior/act either way.
Thank you!