Mercurial > altnet-hispano
comparison Agendas/trunk/src/Agendas.Tests/PropuestasTests.cs @ 200:5346c0500594 deploy pre 1.0
Pasando a estructura de db fija, ya no se crea automáticamente.
Se comenta lo referente a Patrocinadores que queda para alguna futura versión.
Script para tablas de v1.0
author | nelopauselli |
---|---|
date | Wed, 17 Aug 2011 17:54:45 -0300 |
parents | bfd472758bc3 |
children | c61954d24c8c |
comparison
equal
deleted
inserted
replaced
199:39ce09df76dc | 200:5346c0500594 |
---|---|
15 private const string urlInvitacion = "http://groups.google.com/group/altnet-hispano/browse_thread/thread/65d6d26eb381386e"; | 15 private const string urlInvitacion = "http://groups.google.com/group/altnet-hispano/browse_thread/thread/65d6d26eb381386e"; |
16 | 16 |
17 [Test] | 17 [Test] |
18 public void Crear_modificar_y_publicar_evento_propuesto() | 18 public void Crear_modificar_y_publicar_evento_propuesto() |
19 { | 19 { |
20 var agenda = new Agenda(null, DefaultEventoRepository, DefaultPersonaRepository, DefaultPatrocinadorRepository); | 20 var agenda = new Agenda(null, DefaultEventoRepository, DefaultPersonaRepository); |
21 | 21 |
22 agenda.Proponer("Van", null, urlInvitacion, TipoEvento.Van); | 22 agenda.Proponer("Van", null, urlInvitacion, TipoEvento.Van); |
23 { | 23 { |
24 IList<Evento> eventosPropuestos = agenda.GetEventosActivos(EventoPropuestoState.GetInstance()); | 24 IList<Evento> eventosPropuestos = agenda.GetEventosActivos(EventoPropuestoState.GetInstance()); |
25 IList<Evento> eventosAgendados = agenda.GetEventosActivos(EventoAgendadoState.GetInstance()); | 25 IList<Evento> eventosAgendados = agenda.GetEventosActivos(EventoAgendadoState.GetInstance()); |
53 } | 53 } |
54 | 54 |
55 [Test] | 55 [Test] |
56 public void Intentar_agendar_evento_propuesto_sin_indicar_fecha() | 56 public void Intentar_agendar_evento_propuesto_sin_indicar_fecha() |
57 { | 57 { |
58 var agenda = new Agenda(null, DefaultEventoRepository, DefaultPersonaRepository, DefaultPatrocinadorRepository); | 58 var agenda = new Agenda(null, DefaultEventoRepository, DefaultPersonaRepository); |
59 | 59 |
60 { | 60 { |
61 agenda.Proponer("Van propuesta", null, urlInvitacion, TipoEvento.Van); | 61 agenda.Proponer("Van propuesta", null, urlInvitacion, TipoEvento.Van); |
62 } | 62 } |
63 | 63 |
75 } | 75 } |
76 | 76 |
77 [Test] | 77 [Test] |
78 public void Intentar_agendar_evento_propuesto_sin_indicar_ponente() | 78 public void Intentar_agendar_evento_propuesto_sin_indicar_ponente() |
79 { | 79 { |
80 var agenda = new Agenda(null, DefaultEventoRepository, DefaultPersonaRepository, DefaultPatrocinadorRepository); | 80 var agenda = new Agenda(null, DefaultEventoRepository, DefaultPersonaRepository); |
81 | 81 |
82 { | 82 { |
83 agenda.Proponer("Van propuesta", null, urlInvitacion, TipoEvento.Van); | 83 agenda.Proponer("Van propuesta", null, urlInvitacion, TipoEvento.Van); |
84 } | 84 } |
85 | 85 |
99 [Test] | 99 [Test] |
100 public void Intentar_obtener_un_evento_inexistente() | 100 public void Intentar_obtener_un_evento_inexistente() |
101 { | 101 { |
102 var idEventoNoExistente = new Guid("99999999999999999999999999999999"); | 102 var idEventoNoExistente = new Guid("99999999999999999999999999999999"); |
103 | 103 |
104 var agenda = new Agenda(null, DefaultEventoRepository, DefaultPersonaRepository, DefaultPatrocinadorRepository); | 104 var agenda = new Agenda(null, DefaultEventoRepository, DefaultPersonaRepository); |
105 | 105 |
106 Assert.Throws<EventoNotFoundException>(() => agenda.GetEvento(idEventoNoExistente)); | 106 Assert.Throws<EventoNotFoundException>(() => agenda.GetEvento(idEventoNoExistente)); |
107 } | 107 } |
108 | 108 |
109 [Test] | 109 [Test] |
110 public void Intentar_proponer_evento_sin_titulo() | 110 public void Intentar_proponer_evento_sin_titulo() |
111 { | 111 { |
112 var repository = new Mock<IEventoRepository>(); | 112 var repository = new Mock<IEventoRepository>(); |
113 | 113 |
114 var agenda = new Agenda(null, repository.Object, DefaultPersonaRepository, DefaultPatrocinadorRepository); | 114 var agenda = new Agenda(null, repository.Object, DefaultPersonaRepository); |
115 | 115 |
116 var r = agenda.Proponer(string.Empty, null, urlInvitacion, TipoEvento.Van); | 116 var r = agenda.Proponer(string.Empty, null, urlInvitacion, TipoEvento.Van); |
117 Assert.IsFalse(r.Succeful); | 117 Assert.IsFalse(r.Succeful); |
118 | 118 |
119 repository.Verify(p => p.Save(It.IsAny<Evento>()), Times.Exactly(0)); | 119 repository.Verify(p => p.Save(It.IsAny<Evento>()), Times.Exactly(0)); |
120 } | 120 } |
121 | 121 |
122 [Test] | 122 [Test] |
123 public void Intentar_proponer_evento_sin_usuario_autenticado() | 123 public void Intentar_proponer_evento_sin_usuario_autenticado() |
124 { | 124 { |
125 var agenda = new Agenda(null, DefaultEventoRepository, DefaultPersonaRepository, DefaultPatrocinadorRepository); | 125 var agenda = new Agenda(null, DefaultEventoRepository, DefaultPersonaRepository); |
126 | 126 |
127 SetCurrentUser(null, null); | 127 SetCurrentUser(null, null); |
128 | 128 |
129 Assert.Throws<UsuarioNoAutenticadoException>(() => agenda.Proponer("Inmortalidad de la meduza.", null, urlInvitacion, TipoEvento.Van)); | 129 Assert.Throws<UsuarioNoAutenticadoException>(() => agenda.Proponer("Inmortalidad de la meduza.", null, urlInvitacion, TipoEvento.Van)); |
130 } | 130 } |
131 | 131 |
132 [Test] | 132 [Test] |
133 public void Proponer_evento_correctamente() | 133 public void Proponer_evento_correctamente() |
134 { | 134 { |
135 var agenda = new Agenda(null, DefaultEventoRepository, DefaultPersonaRepository, DefaultPatrocinadorRepository); | 135 var agenda = new Agenda(null, DefaultEventoRepository, DefaultPersonaRepository); |
136 agenda.Proponer("Van propuesta", null, urlInvitacion, TipoEvento.Van); | 136 agenda.Proponer("Van propuesta", null, urlInvitacion, TipoEvento.Van); |
137 | 137 |
138 IList<Evento> eventosPropuestos = agenda.GetEventosActivos(EventoPropuestoState.GetInstance()); | 138 IList<Evento> eventosPropuestos = agenda.GetEventosActivos(EventoPropuestoState.GetInstance()); |
139 Assert.IsNotNull(eventosPropuestos); | 139 Assert.IsNotNull(eventosPropuestos); |
140 Assert.AreEqual(1, eventosPropuestos.Count); | 140 Assert.AreEqual(1, eventosPropuestos.Count); |
142 } | 142 } |
143 | 143 |
144 [Test] | 144 [Test] |
145 public void Verificar_propuesta_separada_de_publicacion() | 145 public void Verificar_propuesta_separada_de_publicacion() |
146 { | 146 { |
147 var agenda = new Agenda(null, DefaultEventoRepository, DefaultPersonaRepository, DefaultPatrocinadorRepository); | 147 var agenda = new Agenda(null, DefaultEventoRepository, DefaultPersonaRepository); |
148 | 148 |
149 agenda.Proponer("Van propuesta", null, urlInvitacion, TipoEvento.Van); | 149 agenda.Proponer("Van propuesta", null, urlInvitacion, TipoEvento.Van); |
150 var fechaInicio = DateTime.Now.ToUniversalTime(); | 150 var fechaInicio = DateTime.Now.ToUniversalTime(); |
151 var fechaTermino = fechaInicio.AddHours(2); | 151 var fechaTermino = fechaInicio.AddHours(2); |
152 var r = agenda.Agendar("Van publicada", TestsHelper.GetOrCreatePonente("jjmontes"), fechaInicio, fechaTermino, | 152 var r = agenda.Agendar("Van publicada", TestsHelper.GetOrCreatePonente("jjmontes"), fechaInicio, fechaTermino, |