Skip to content

TestGit#28

Open
JoSchmidtIBW wants to merge 4 commits intoibwgr:masterfrom
JoSchmidtIBW:uebung-assertionsFakeMockMokito
Open

TestGit#28
JoSchmidtIBW wants to merge 4 commits intoibwgr:masterfrom
JoSchmidtIBW:uebung-assertionsFakeMockMokito

Conversation

@JoSchmidtIBW
Copy link

No description provided.

@Test
void returnsTrueIfOnlyLetters(){
throw new IllegalArgumentException("you should implement code here");
//kein mokito
Copy link
Contributor

Choose a reason for hiding this comment

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

Die Idee all dieser isValidUsername Testfälle ist es, sicherzustellen, dass alle Szenarien (z.B. "OnlyLetters") von der Methode isValidUsername korrekt erkannt werden.
z.B. für den returnsTrueIfOnlyLetters Testfall könnten die Assertion sein: Assertions.assertFalse(new User(",,,,").isValidUsername()); Assertions.assertTrue(new User("abcdefg").isValidUsername());

Im Testfall selbst befindet sich keine if oder for Schlaufe. Dieser Validierungsalgorithmus muss in die User Klasse.

@Test
void returnsTrueIfUsernameInDB(){
throw new IllegalArgumentException("you should implement code here");
void returnsTrueIfUsernameInDB(){ //Test ist immer grün, auch wenn irgend welcher Code gelöscht wird...??????????????????????????
Copy link
Contributor

Choose a reason for hiding this comment

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

Klar ist der immer grün ;) Schau mal wo überall du auf deine mockDatabase zugreifst, und wo überall du darauf zugreifen solltest ;)

Mok/ Mokito noch offen
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.

2 participants