You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
849 B

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Assertions;
class CredentialRepositoryTest {
private CredentialRepository credentialRepository;
@BeforeEach
public void setUp()
{
credentialRepository = new CredentialRepository();
}
@Test
void createNewCredentialAndAddToList() {
Assertions.assertEquals(1, this.credentialRepository.createNewCredential("mock", "mock"));
Assertions.assertEquals(2, this.credentialRepository.createNewCredential("kek", "mate"));
}
}
/*
Exception failed = Assertions.assertThrows(Exception.class, () -> {
this.credentialRepository.createNewCredential(null,null);
});
Assertions.assertEquals("kein leeres Objekt erstellen", failed.getMessage());
*/