# HG changeset patch # User nelo@MTEySS.neluz.int # Date 1300189500 10800 # Node ID 71b02443450a16c6253f78d678b7dc01aa0d997c # Parent e8d2be47a6b00fda64a6ed5a445ffd989eff580a UI de Propuestas de VANs diff -r e8d2be47a6b0 -r 71b02443450a Agendas/trunk/src/Agendas.Domain/Agenda.cs --- a/Agendas/trunk/src/Agendas.Domain/Agenda.cs Tue Mar 15 08:24:18 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Domain/Agenda.cs Tue Mar 15 08:45:00 2011 -0300 @@ -48,15 +48,17 @@ _recordador.Recordar(evento); } - public void Proponer(string titulo) + public void Proponer(string titulo, string ponenteNombre) { - var evento = new Evento {Titulo = titulo}; + var ponente = GetPonente(ponenteNombre); + var evento = new Evento {Titulo = titulo, Ponente = ponente}; if (string.IsNullOrWhiteSpace(evento.Titulo)) throw new ValidationException(); if (NoEstaAutenticado(_seguridad)) throw new UsuarioNoAutenticadoException(); _eventosRepository.Save(evento); + _ponenteRepository.Save(ponente); } public IList GetEventosPropuestos() @@ -88,7 +90,7 @@ evento.Fecha = fecha; } - public Evento GetEventoPublicado(Guid id) + public Evento GetEvento(Guid id) { return _eventosRepository.Get(id); } @@ -104,6 +106,10 @@ return _ponenteRepository.GetByNombre(nombre) ?? new Ponente { Nombre = nombre }; } + public void ModificarPropuesta(Guid id, string titulo, string ponenteNombre) + { + ModificarEvento(id, titulo, ponenteNombre, null); + } } public class EventoNotFoundException : Exception diff -r e8d2be47a6b0 -r 71b02443450a Agendas/trunk/src/Agendas.Tests/PropuestasTests.cs --- a/Agendas/trunk/src/Agendas.Tests/PropuestasTests.cs Tue Mar 15 08:24:18 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Tests/PropuestasTests.cs Tue Mar 15 08:45:00 2011 -0300 @@ -19,7 +19,7 @@ var agenda = new Agenda(null, null, seguridad.Object, DefaultEventoRepository, DefaultPonenteRepository); seguridad.Setup(s => s.GetPrincipal()).Returns(SeguridadObjectMother.GetGenericPrincipalAutenticadoSinRoles()); - agenda.Proponer("Van propuesta"); + agenda.Proponer("Van propuesta", null); IList eventosPropuestos = agenda.GetEventosPropuestos(); Assert.IsNotNull(eventosPropuestos); @@ -32,7 +32,7 @@ { var agenda = new Agenda(null, null, SeguridadServiceDefault, DefaultEventoRepository, DefaultPonenteRepository); - agenda.Proponer("Van propuesta"); + agenda.Proponer("Van propuesta", null); agenda.Publicar("Van publicada", "jjmontes", DateTime.Now); IList eventosPropuestos = agenda.GetEventosPropuestos(); @@ -49,8 +49,8 @@ var seguridad = new Mock(); var agenda = new Agenda(null, null, seguridad.Object, repository.Object, DefaultPonenteRepository); - - Assert.Throws(() => agenda.Proponer(string.Empty)); + + Assert.Throws(() => agenda.Proponer(string.Empty, null)); repository.Verify(p => p.Save(It.IsAny()), Times.Exactly(0)); } @@ -64,7 +64,7 @@ seguridad.Setup(s => s.GetPrincipal()).Returns(SeguridadObjectMother.GetGenericPrincipalAutenticadoSinRoles()); { - agenda.Proponer("Van propuesta"); + agenda.Proponer("Van propuesta", null); } { @@ -83,7 +83,7 @@ seguridad.Setup(s => s.GetPrincipal()).Returns(SeguridadObjectMother.GetGenericPrincipalAutenticadoSinRoles()); { - agenda.Proponer("Van propuesta"); + agenda.Proponer("Van propuesta", null); } { diff -r e8d2be47a6b0 -r 71b02443450a Agendas/trunk/src/Agendas.Web/Agendas.Web.csproj --- a/Agendas/trunk/src/Agendas.Web/Agendas.Web.csproj Tue Mar 15 08:24:18 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/Agendas.Web.csproj Tue Mar 15 08:45:00 2011 -0300 @@ -60,12 +60,14 @@ + Global.asax - + + @@ -146,6 +148,15 @@ + + + + + + + + +