Skip to content

Conversation

GiuseppeBnn
Copy link

Added verify exercise in src folder and relative test.
The test cover positive cases and negative cases.

Copy link
Author

@GiuseppeBnn GiuseppeBnn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ho corretto tutto e migliorato tutto quello indicato, lasciando l'array predefinito perchè la consegna lo richiede esplicitamente

Copy link
Author

@GiuseppeBnn GiuseppeBnn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fatto tutto

@makapx makapx self-requested a review November 8, 2023 17:57
fail_test_array = range(35,100)
import src.verify as verify

def test_verify():

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rinomina la funzione, leggendo la firma del metodo non è chiaro cosa stai testando.

assert verify.is_element_in_list(i) == True
for i in fail_test_array:
if i not in success_test_array:
assert verify.is_element_in_list(i) == False

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cosa te ne pare di definire due funzioni separate? Una che testa solo i casi positivi e una solo i casi negativi.
Poi nel tuo metodo principale chiami entrambi.


def test_verify():
for i in success_test_array:
assert verify.is_element_in_list(i) == True

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

== True è superfluo.
Puoi usare

assert verify.is_element_in_list(i)
assert not verify.is_element_in_list(i)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants