From VisualWorks® NonCommercial, 7.2 of November 3, 2003 on June 13, 2004 at 7:20:12 pm
MarcadorDeReuniaoTest
Smalltalk
XProgramming.SUnit.TestCase
false
none
ale kon dia15mes4de2004 dia16mes4de2004 dia17mes4de2004 dia18mes4de2004 dia19mes4de2004 dia20mes4de2004 listaDeParticipantesDaDiretoria marcadorDaReuniaoDaDiretoria marcadorDaReuniaoDaGalera joao jose maria ana listaDeParticipantesDaGalera as8horas as2horasDaManha as10horas aoMeioDia as14horas as16horas as18horas as20horas aMeiaNoite
ColoqueONomeDoSeuPacoteAqui
ColoqueONomeDoSeuPacoteAqui
MarcadorDeReuniaoTest testing
setUp
marcadorDaReuniaoDaDiretoria := MarcadorDeReuniao new.
marcadorDaReuniaoDaGalera := MarcadorDeReuniao new.
dia15mes4de2004 := Date
newDay: 15
monthNumber: 4
year: 2004.
dia16mes4de2004 := Date
newDay: 16
monthNumber: 4
year: 2004.
dia17mes4de2004 := Date
newDay: 17
monthNumber: 4
year: 2004.
dia18mes4de2004 := Date
newDay: 18
monthNumber: 4
year: 2004.
dia19mes4de2004 := Date
newDay: 19
monthNumber: 4
year: 2004.
dia20mes4de2004 := Date
newDay: 20
monthNumber: 4
year: 2004.
as8horas := Time readFrom: (ReadStream on: '8:00').
as10horas := Time readFrom: (ReadStream on: '10:00').
aoMeioDia := Time readFrom: (ReadStream on: '12:00pm').
as14horas := Time readFrom: (ReadStream on: '14:00').
as16horas := Time readFrom: (ReadStream on: '16:00').
as18horas := Time readFrom: (ReadStream on: '18:00').
as20horas := Time readFrom: (ReadStream on: '20:00').
aMeiaNoite := Time readFrom: (ReadStream on: '12:00am').
as2horasDaManha := Time readFrom: (ReadStream on: '2:00am').
ale := 'AlexandreFreireDaSilva@ime.usp.br'.
kon := 'FabioKon@ime.usp.br'.
joao := 'joao@correio.br'.
jose := 'jose@correio.br'.
maria := 'maria@correio.br'.
ana := 'ana@correio.br'.
(listaDeParticipantesDaDiretoria := OrderedCollection new) add: ale.
listaDeParticipantesDaDiretoria add: kon.
(listaDeParticipantesDaGalera := OrderedCollection new) add: ale.
listaDeParticipantesDaGalera add: kon.
listaDeParticipantesDaGalera add: joao.
listaDeParticipantesDaGalera add: jose.
listaDeParticipantesDaGalera add: maria.
listaDeParticipantesDaGalera add: ana.
self marcaUmaReuniaoDaDiretoria.
self marcaUmaReuniao.
^self
testSobreposicaoComHoraQuebrada
marcadorDaReuniaoDaDiretoria
indicaDisponibilidadeDe: ale
de: (Timestamp fromDate: dia18mes4de2004 andTime: (Time readFrom: (ReadStream on: '3:30pm')))
a: (Timestamp fromDate: dia18mes4de2004 andTime: (Time readFrom: (ReadStream on: '4:27pm'))).
marcadorDaReuniaoDaDiretoria
indicaDisponibilidadeDe: kon
de: (Timestamp fromDate: dia18mes4de2004 andTime: (Time readFrom: (ReadStream on: '3:46pm')))
a: (Timestamp fromDate: dia18mes4de2004 andTime: (Time readFrom: (ReadStream on: '5:30pm'))).
marcadorDaReuniaoDaDiretoria mostraSobreposicao.
^self
testAdicionaDisponibilidadeComComecoAntesDoInicio
" ***This is decompiled code.***
The source was unavailable because the source pointer appears to point to
an incorrect position in the file. The file may have been modified after this
method was updated."
| t1 |
t1 := Timestamp fromDate: dia15mes4de2004 andTime: Time now.
self should: [marcadorDaReuniaoDaDiretoria
indicaDisponibilidadeDe: ale
de: t1
a: (t1 addSeconds: 6000)]
raise: GenericException.
^self
testAdicionaDisponibilidadeComFimAntesDoComeco
" ***This is decompiled code.***
The source was unavailable because the source pointer appears to point to
an incorrect position in the file. The file may have been modified after this
method was updated."
| comeco |
comeco := (Timestamp fromDate: dia19mes4de2004 andTime: as14horas).
self should: [marcadorDaReuniaoDaDiretoria
indicaDisponibilidadeDe: ale
de: comeco
a: (comeco subtractSeconds: 6000)]
raise: GenericException.
^self
testAdicionaDisponibilidadeDeParticipanteQueNaoExiste
" ***This is decompiled code.***
The source was unavailable because the source pointer appears to point to
an incorrect position in the file. The file may have been modified after this
method was updated."
self should: [marcadorDaReuniaoDaDiretoria
indicaDisponibilidadeDe: 'desconhecido'
de: (Timestamp fromDate: dia19mes4de2004 andTime: as14horas)
a: (Timestamp fromDate: dia19mes4de2004 andTime: as16horas)]
raise: GenericException.
^self
testAdicionaDisponibilidadeDepoisDoFim
" ***This is decompiled code.***
The source was unavailable because the source pointer appears to point to
an incorrect position in the file. The file may have been modified after this
method was updated."
| t1 |
t1 := Timestamp fromDate: (dia20mes4de2004 addDays: 1)
andTime: Time now.
self should: [marcadorDaReuniaoDaDiretoria
indicaDisponibilidadeDe: ale
de: t1
a: (t1 addSeconds: 6000)]
raise: GenericException.
^self
testSobreposicaoComplexa
marcadorDaReuniaoDaGalera
indicaDisponibilidadeDe: ale
de: (Timestamp fromDate: dia15mes4de2004 andTime: as14horas)
a: (Timestamp fromDate: dia15mes4de2004 andTime: as18horas).
marcadorDaReuniaoDaGalera
indicaDisponibilidadeDe: ale
de: (Timestamp fromDate: dia16mes4de2004 andTime: as14horas)
a: (Timestamp fromDate: dia16mes4de2004 andTime: as18horas).
marcadorDaReuniaoDaGalera
indicaDisponibilidadeDe: ale
de: (Timestamp fromDate: dia17mes4de2004 andTime: as14horas)
a: (Timestamp fromDate: dia17mes4de2004 andTime: as18horas).
marcadorDaReuniaoDaGalera
indicaDisponibilidadeDe: ale
de: (Timestamp fromDate: dia18mes4de2004 andTime: as14horas)
a: (Timestamp fromDate: dia18mes4de2004 andTime: as18horas).
marcadorDaReuniaoDaGalera
indicaDisponibilidadeDe: ale
de: (Timestamp fromDate: dia19mes4de2004 andTime: as14horas)
a: (Timestamp fromDate: dia19mes4de2004 andTime: as18horas).
marcadorDaReuniaoDaGalera
indicaDisponibilidadeDe: ale
de: (Timestamp fromDate: dia20mes4de2004 andTime: as14horas)
a: (Timestamp fromDate: dia20mes4de2004 andTime: as18horas).
marcadorDaReuniaoDaGalera
indicaDisponibilidadeDe: kon
de: (Timestamp fromDate: dia15mes4de2004 andTime: as8horas)
a: (Timestamp fromDate: dia18mes4de2004 andTime: as20horas).
marcadorDaReuniaoDaGalera
indicaDisponibilidadeDe: joao
de: (Timestamp fromDate: dia15mes4de2004 andTime: as2horasDaManha)
a: (Timestamp fromDate: dia16mes4de2004 andTime: as20horas).
marcadorDaReuniaoDaGalera
indicaDisponibilidadeDe: joao
de: (Timestamp fromDate: dia18mes4de2004 andTime: aMeiaNoite)
a: (Timestamp fromDate: dia19mes4de2004 andTime: as2horasDaManha).
marcadorDaReuniaoDaGalera
indicaDisponibilidadeDe: joao
de: (Timestamp fromDate: dia20mes4de2004 andTime: as10horas)
a: (Timestamp fromDate: dia20mes4de2004 andTime: as14horas).
marcadorDaReuniaoDaGalera
indicaDisponibilidadeDe: jose
de: (Timestamp fromDate: dia15mes4de2004 andTime: aoMeioDia)
a: (Timestamp fromDate: dia15mes4de2004 andTime: as16horas).
marcadorDaReuniaoDaGalera
indicaDisponibilidadeDe: jose
de: (Timestamp fromDate: dia16mes4de2004 andTime: aoMeioDia)
a: (Timestamp fromDate: dia16mes4de2004 andTime: as16horas).
marcadorDaReuniaoDaGalera
indicaDisponibilidadeDe: jose
de: (Timestamp fromDate: dia17mes4de2004 andTime: aoMeioDia)
a: (Timestamp fromDate: dia17mes4de2004 andTime: as16horas).
marcadorDaReuniaoDaGalera
indicaDisponibilidadeDe: jose
de: (Timestamp fromDate: dia18mes4de2004 andTime: aoMeioDia)
a: (Timestamp fromDate: dia18mes4de2004 andTime: as16horas).
marcadorDaReuniaoDaGalera
indicaDisponibilidadeDe: maria
de: (Timestamp fromDate: dia17mes4de2004 andTime: as8horas)
a: (Timestamp fromDate: dia17mes4de2004 andTime: as18horas).
marcadorDaReuniaoDaGalera
indicaDisponibilidadeDe: maria
de: (Timestamp fromDate: dia18mes4de2004 andTime: as8horas)
a: (Timestamp fromDate: dia18mes4de2004 andTime: as18horas).
marcadorDaReuniaoDaGalera
indicaDisponibilidadeDe: maria
de: (Timestamp fromDate: dia19mes4de2004 andTime: as8horas)
a: (Timestamp fromDate: dia19mes4de2004 andTime: as18horas).
marcadorDaReuniaoDaGalera
indicaDisponibilidadeDe: maria
de: (Timestamp fromDate: dia20mes4de2004 andTime: as10horas)
a: (Timestamp fromDate: dia20mes4de2004 andTime: as14horas).
marcadorDaReuniaoDaGalera
indicaDisponibilidadeDe: ana
de: (Timestamp fromDate: dia15mes4de2004 andTime: as8horas)
a: (Timestamp fromDate: dia20mes4de2004 andTime: as2horasDaManha).
marcadorDaReuniaoDaGalera mostraSobreposicao.
^self
testSobreposicaoComUmCaraQuePodeDois
" ***This is decompiled code.***
The source was unavailable because the source pointer appears to point to
an incorrect position in the file. The file may have been modified after this
method was updated."
marcadorDaReuniaoDaGalera
indicaDisponibilidadeDe: ale
de: (Timestamp fromDate: dia18mes4de2004 andTime: aoMeioDia)
a: (Timestamp fromDate: dia18mes4de2004 andTime: as16horas).
marcadorDaReuniaoDaGalera
indicaDisponibilidadeDe: kon
de: (Timestamp fromDate: dia18mes4de2004 andTime: aoMeioDia)
a: (Timestamp fromDate: dia18mes4de2004 andTime: as14horas).
marcadorDaReuniaoDaGalera
indicaDisponibilidadeDe: maria
de: (Timestamp fromDate: dia18mes4de2004 andTime: as14horas)
a: (Timestamp fromDate: dia18mes4de2004 andTime: as16horas).
marcadorDaReuniaoDaGalera mostraSobreposicao.
^self
testSobreposicaoComUmCaraSoh
marcadorDaReuniaoDaDiretoria
indicaDisponibilidadeDe: ale
de: (Timestamp fromDate: dia18mes4de2004 andTime: aoMeioDia)
a: (Timestamp fromDate: dia18mes4de2004 andTime: as18horas).
marcadorDaReuniaoDaDiretoria
indicaDisponibilidadeDe: ale
de: (Timestamp fromDate: dia18mes4de2004 andTime: as14horas)
a: (Timestamp fromDate: dia18mes4de2004 andTime: as16horas).
marcadorDaReuniaoDaDiretoria
indicaDisponibilidadeDe: ale
de: (Timestamp fromDate: dia18mes4de2004 andTime: as18horas)
a: (Timestamp fromDate: dia18mes4de2004 andTime: as20horas).
marcadorDaReuniaoDaDiretoria
indicaDisponibilidadeDe: ale
de: (Timestamp fromDate: dia19mes4de2004 andTime: as14horas)
a: (Timestamp fromDate: dia19mes4de2004 andTime: as16horas).
marcadorDaReuniaoDaDiretoria
indicaDisponibilidadeDe: ale
de: (Timestamp fromDate: dia18mes4de2004 andTime: as16horas)
a: (Timestamp fromDate: dia18mes4de2004 andTime: as18horas).
marcadorDaReuniaoDaDiretoria mostraSobreposicao.
testSobreposicaoSemSolucao
" ***This is decompiled code.***
The source was unavailable because the source pointer appears to point to
an incorrect position in the file. The file may have been modified after this
method was updated."
marcadorDaReuniaoDaDiretoria
indicaDisponibilidadeDe: ale
de: (Timestamp fromDate: dia18mes4de2004 andTime: as14horas)
a: (Timestamp fromDate: dia18mes4de2004 andTime: as16horas).
marcadorDaReuniaoDaDiretoria
indicaDisponibilidadeDe: kon
de: (Timestamp fromDate: dia18mes4de2004 andTime: aoMeioDia)
a: (Timestamp fromDate: dia18mes4de2004 andTime: as14horas).
marcadorDaReuniaoDaDiretoria mostraSobreposicao.
^self
MarcadorDeReuniaoTest private
marcaUmaReuniao
" ***This is decompiled code.***
The source was unavailable because the source pointer appears to point to
an incorrect position in the file. The file may have been modified after this
method was updated."
marcadorDaReuniaoDaGalera
marqueReuniaoEntre: dia15mes4de2004
E: dia20mes4de2004
comParticipantes: listaDeParticipantesDaGalera.
^self
marcaUmaReuniaoDaDiretoria
" ***This is decompiled code.***
The source was unavailable because the source pointer appears to point to
an incorrect position in the file. The file may have been modified after this
method was updated."
marcadorDaReuniaoDaDiretoria
marqueReuniaoEntre: dia18mes4de2004
E: dia20mes4de2004
comParticipantes: listaDeParticipantesDaDiretoria.
^self