forked from marqueswill/trabalho2-TP1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstubs.h
More file actions
145 lines (117 loc) · 4.54 KB
/
stubs.h
File metadata and controls
145 lines (117 loc) · 4.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#ifndef STUBS_H_INCLUDED
#define STUBS_H_INCLUDED
#include "interfaces.h"
//----------------------------------------------------------------------------------------------------------------------
class StubISAutenticacao : public ISAutenticacao {
private:
static Matricula matriculaStub;
static Senha senhaStub;
const static string VALOR_VALIDO_MATRICULA;
const static string VALOR_VALIDO_SENHA;
const static bool SUCESSO = true;
const static bool FALHA = false;
bool resultado;
public:
StubISAutenticacao() {
matriculaStub.setValor(VALOR_VALIDO_MATRICULA);
senhaStub.setValor(VALOR_VALIDO_SENHA);
}
bool autenticar(Matricula, Senha);
};
//----------------------------------------------------------------------------------------------------------------------
class StubISDesenvolvedor : public ISDesenvolvedor {
private:
static Desenvolvedor desenvolvedorStub;
static Matricula matriculaDesenvolvedor;
static Texto nomeDesenvolvedor;
static Senha senhaDesenvolvedor;
static Telefone telefoneDesenvolvedor;
const static string VALOR_VALIDO_MATRICULA;
const static string VALOR_VALIDO_NOME;
const static string VALOR_VALIDO_SENHA;
const static string VALOR_VALIDO_TELEFONE;
const static bool SUCESSO = true;
const static bool FALHA = false;
bool resultado;
public:
StubISDesenvolvedor() {
matriculaDesenvolvedor.setValor(VALOR_VALIDO_MATRICULA);
nomeDesenvolvedor.setValor(VALOR_VALIDO_NOME);
senhaDesenvolvedor.setValor(VALOR_VALIDO_SENHA);
telefoneDesenvolvedor.setValor(VALOR_VALIDO_TELEFONE);
desenvolvedorStub.setMatricula(matriculaDesenvolvedor);
desenvolvedorStub.setNome(nomeDesenvolvedor);
desenvolvedorStub.setSenha(senhaDesenvolvedor);
desenvolvedorStub.setTelefone(telefoneDesenvolvedor);
}
bool visualizar(Desenvolvedor *);
bool cadastrar(Desenvolvedor);
bool editar(Desenvolvedor);
bool descadastrar(Matricula);
};
//----------------------------------------------------------------------------------------------------------------------
class StubISTeste : public ISTeste {
private:
static Teste testeStub;
static Codigo codigoTeste;
static Texto nomeTeste;
static Classe classeTeste;
const static string VALOR_VALIDO_CODIGO;
const static string VALOR_VALIDO_NOME;
const static string VALOR_VALIDO_CLASSE;
const static bool SUCESSO = true;
const static bool FALHA = false;
bool resultado;
public:
StubISTeste() {
codigoTeste.setValor(VALOR_VALIDO_CODIGO);
nomeTeste.setValor(VALOR_VALIDO_NOME);
classeTeste.setValor(VALOR_VALIDO_CLASSE);
testeStub.setCodigo(codigoTeste);
testeStub.setNome(nomeTeste);
testeStub.setClasse(classeTeste);
};
bool visualizar(Teste *);
bool cadastrar(Teste);
bool editar(Teste);
bool descadastrar(Codigo);
};
//----------------------------------------------------------------------------------------------------------------------
class StubISCasoDeTeste : public ISCasoDeTeste {
private:
static CasoDeTeste casoDeTesteStub;
static Codigo codigoCasoDeTeste;
static Texto nomeCasoDeTeste;
static Data dataCasoDeTeste;
static Texto acaoCasoDeTeste;
static Texto respostaCasoDeTeste;
static Resultado resultadoCasoDeTeste;
const static string VALOR_VALIDO_CODIGO;
const static string VALOR_VALIDO_NOME;
const static string VALOR_VALIDO_DATA;
const static string VALOR_VALIDO_ACAO;
const static string VALOR_VALIDO_RESPOSTA;
const static string VALOR_VALIDO_RESULTADO;
const static bool SUCESSO = true;
const static bool FALHA = false;
public:
StubISCasoDeTeste() {
codigoCasoDeTeste.setValor(VALOR_VALIDO_CODIGO);
nomeCasoDeTeste.setValor(VALOR_VALIDO_NOME);
dataCasoDeTeste.setValor(VALOR_VALIDO_DATA);
acaoCasoDeTeste.setValor(VALOR_VALIDO_ACAO);
respostaCasoDeTeste.setValor(VALOR_VALIDO_RESPOSTA);
resultadoCasoDeTeste.setValor(VALOR_VALIDO_RESULTADO);
casoDeTesteStub.setCodigo(codigoCasoDeTeste);
casoDeTesteStub.setNome(nomeCasoDeTeste);
casoDeTesteStub.setData(dataCasoDeTeste);
casoDeTesteStub.setAcao(acaoCasoDeTeste);
casoDeTesteStub.setResposta(respostaCasoDeTeste);
casoDeTesteStub.setResultado(resultadoCasoDeTeste);
}
bool visualizar(CasoDeTeste *);
bool cadastrar(CasoDeTeste);
bool editar(CasoDeTeste);
bool descadastrar(Codigo);
};
#endif // STUBS_H_INCLUDED