Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
133 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package exception; | ||
|
||
public class EstoqueInsuficienteException extends VendaException { // checked exception | ||
|
||
|
||
} |
This file was deleted.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
LojaVirtual/src/exception/ItemInexisteNoCatalogoException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package exception; | ||
|
||
public class ItemInexisteNoCatalogoException extends VendaException { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package exception; | ||
|
||
public class VendaException extends Exception { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
public class DreDesconhecidoException extends Exception { | ||
|
||
private long dreDesconhecido; | ||
|
||
public DreDesconhecidoException(long dreDesconhecido) { | ||
this.dreDesconhecido = dreDesconhecido; | ||
} | ||
|
||
public long getDreDesconhecido() { | ||
return this.dreDesconhecido; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
public class SiguinhaTest { | ||
|
||
private Siguinha siguinha; | ||
|
||
@Before | ||
public void setUp() { | ||
this.siguinha = new Siguinha("UFRJ"); | ||
} | ||
|
||
@Test | ||
public void testarInscricaoDeAlunoEmDisciplina() { | ||
|
||
} | ||
|
||
@Test | ||
public void testarInscricaoDeAlunoComDreInvalido() { | ||
Disciplina calculo1 = new Disciplina("Cálculo 1", 5, "blah"); | ||
Turma turma = new Turma(calculo1, new Periodo(2020, 1)); | ||
try { | ||
siguinha.inscreverAlunoEmTurma(36523564, turma); | ||
fail("Dres inválidos precisam ser notificados!"); | ||
|
||
} catch (DreDesconhecidoException e) { | ||
assertEquals(36523564, e.getDreDesconhecido()); | ||
} | ||
} | ||
} |