view Agendas/trunk/src/Agendas.Tests/TrackTests.cs @ 75:96d7609f2e08

Agendar evento propuesto
author nelopauselli
date Mon, 23 May 2011 20:43:01 -0300
parents bc46e7426c80
children c2d98fd6593f
line wrap: on
line source

using System;
using System.Linq;
using AltNetHispano.Agendas.Domain;
using NUnit.Framework;

namespace AltNetHispano.Agendas.Tests
{
	[TestFixture]
	public class TrackTests : TestBase
	{
		private const string urlInvitacion = "http://groups.google.com/group/altnet-hispano/browse_thread/thread/65d6d26eb381386e";

		[Test]
		public void Track_al_publicar_y_modificar_evento()
		{
			var repository = DefaultEventoRepository;

			var agenda = new Agenda(null, null, repository, DefaultPonenteRepository);

			var fecha = DateTime.Now.AddDays(5);
			agenda.Agendar("Html 5", "jjmontes", fecha, urlInvitacion);
			var evento = repository.GetEventosConFecha().First();

			Assert.AreEqual(1, evento.Tracks.Count());
			Assert.AreEqual(Accion.Agendar, evento.Tracks.Last().Accion);

			agenda.ModificarEvento(evento.Id, "Html 5", "otro ponente", fecha, urlInvitacion);
			Assert.AreEqual(2, evento.Tracks.Count());
			Assert.AreEqual(Accion.Modificar, evento.Tracks.Last().Accion);

			agenda.ModificarEvento(evento.Id, "Html 5 y Css 3", "otro ponente", fecha, urlInvitacion);
			Assert.AreEqual(3, evento.Tracks.Count());
			Assert.AreEqual(Accion.CambiarTitulo, evento.Tracks.Last().Accion);
		}

		[Test]
		public void Track_al_publicar_y_confirmar_evento()
		{
			var repository = DefaultEventoRepository;

			var agenda = new Agenda(null, null, repository, DefaultPonenteRepository);

			agenda.Agendar("Html 5", "jjmontes", DateTime.Now,
				urlInvitacion);
			var evento = repository.GetEventosConFecha().First();

			Assert.AreEqual(1, evento.Tracks.Count());
			Assert.AreEqual(Accion.Agendar, evento.Tracks.Last().Accion);

			//TODO: confirmar evento y evaluar .tracks
		}
	}
}