Mercurial > altnet-hispano
view Agendas/trunk/src/Agendas.Domain/EventoCanceladoState.cs @ 134:a4ef6874ec81
Se termina prueba unitaria que verifica que se cree el evento solo si la acción es Agendar.
author | alabra |
---|---|
date | Sun, 17 Jul 2011 13:58:31 -0400 |
parents | 6f1041301797 |
children | 3639803112c6 |
line wrap: on
line source
using AltNetHispano.Agendas.Domain.Exceptions; namespace AltNetHispano.Agendas.Domain { public class EventoCanceladoState : EventoState { private EventoCanceladoState() { } private static readonly EventoState _instance = new EventoCanceladoState(); public static EventoState GetInstance() { return _instance; } private const string Descripcion = "Cancelado"; public override void Promover(Evento evento, Accion accion) { switch (accion) { case Accion.Descartar: evento.SetEstado(EventoDescartadoState.GetInstance()); evento.AddTrack(new Track(evento, Accion.Descartar)); break; case Accion.ReAgendar: evento.SetEstado(EventoAgendadoState.GetInstance()); evento.AddTrack(new Track(evento, Accion.ReAgendar)); break; case Accion.ReProponer: evento.SetEstado(EventoPropuestoState.GetInstance()); evento.AddTrack(new Track(evento, Accion.ReProponer)); break; default: throw new AccionNoSoportadaException(this.GetType(), accion); } } public override string GetDescripcion() { return Descripcion; } public override bool PuedePromover(Accion accion) { return accion == Accion.Descartar || accion == Accion.ReAgendar || accion == Accion.ReProponer; } } }