diff --git a/AluguelCarros/.classpath b/AluguelCarros/.classpath index 9aa6d15..dd33a9e 100644 --- a/AluguelCarros/.classpath +++ b/AluguelCarros/.classpath @@ -6,5 +6,6 @@ + diff --git a/AluguelCarros/src/Pessoas/AdminTest.java b/AluguelCarros/src/Pessoas/AdminTest.java new file mode 100644 index 0000000..7373494 --- /dev/null +++ b/AluguelCarros/src/Pessoas/AdminTest.java @@ -0,0 +1,17 @@ +package Pessoas; + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.Test; + +import Sistema.BancoDados; + +class AdminTest { + + @Test + void testTesteLogin() { + BancoDados.cadastrarAdm[0] = new Admin("Login1", "123"); + + assertEquals(false, Admin.TesteLogin("Login1")); + } +} diff --git a/AluguelCarros/src/Pessoas/UsuarioTest.java b/AluguelCarros/src/Pessoas/UsuarioTest.java new file mode 100644 index 0000000..df47ad8 --- /dev/null +++ b/AluguelCarros/src/Pessoas/UsuarioTest.java @@ -0,0 +1,15 @@ +package Pessoas; + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.Test; + +class UsuarioTest { + + @Test + void testIsCPF() { + assertEquals(false, Usuario.isCPF("123456789")); + assertEquals(true, Usuario.isCPF("95337616013")); + } + +} diff --git a/AluguelCarros/src/Sistema/LoginTest.java b/AluguelCarros/src/Sistema/LoginTest.java new file mode 100644 index 0000000..fc9b976 --- /dev/null +++ b/AluguelCarros/src/Sistema/LoginTest.java @@ -0,0 +1,21 @@ +package Sistema; + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.Test; + +import Pessoas.Admin; +import Pessoas.Usuario; + +class LoginTest { + + @Test + void testLogando() { + BancoDados.cadastrarAdm[0] = new Admin("Login", "Senha"); + + assertEquals(false, Login.Logando("Login", "a")); + assertEquals(false, Login.Logando("a", "Senha")); + assertEquals(true, Login.Logando("Login", "Senha")); + } + +} diff --git a/AluguelCarros/src/veiculo/AgenciaTest.java b/AluguelCarros/src/veiculo/AgenciaTest.java new file mode 100644 index 0000000..aa36286 --- /dev/null +++ b/AluguelCarros/src/veiculo/AgenciaTest.java @@ -0,0 +1,20 @@ +package veiculo; + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.Test; + +import Sistema.BancoDados; +import Sistema.Login; + +class AgenciaTest { + + @Test + void testTesteId() { + BancoDados.cadastrarAgencia[0] = new Agencia("AG001", "Rua 3", "35", "Bairro principal", "São Paulo", "Estado do bem", + "Melhor Pais"); + + assertEquals(false, Agencia.TesteId("AG001")); + assertEquals(true, Agencia.TesteId("AG002")); + } +}