Mercurial > altnet-hispano
comparison Agendas/trunk/src/Agendas.Google.Test/PublicadorTest.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 | 81870e6f7e55 |
children | 80156ae1493f |
comparison
equal
deleted
inserted
replaced
133:6f1041301797 | 134:a4ef6874ec81 |
---|---|
1 using System; | 1 using System; |
2 using System.Linq; | |
2 using AltNetHispano.Agendas.Domain; | 3 using AltNetHispano.Agendas.Domain; |
3 using AltNetHispano.Agendas.Google; | 4 using AltNetHispano.Agendas.Google; |
4 using AltNetHispano.Agendas.Google.DetailsEvents; | 5 using AltNetHispano.Agendas.Google.DetailsEvents; |
5 using AltNetHispano.Agendas.Tests; | 6 using AltNetHispano.Agendas.Tests; |
6 using Moq; | 7 using Moq; |
9 namespace Agendas.Google.Test | 10 namespace Agendas.Google.Test |
10 { | 11 { |
11 [TestFixture] | 12 [TestFixture] |
12 public class PublicadorTest : TestBase | 13 public class PublicadorTest : TestBase |
13 { | 14 { |
14 /// <summary> | 15 [Test] |
15 /// Validar que solamente se creen eventos cuando la acción sea Accion.Agendar | |
16 /// </summary> | |
17 [Test, Explicit] | |
18 public void CuandoPublicarEventoDadoAccionAgendarEntoncesEventoCreado() | 16 public void CuandoPublicarEventoDadoAccionAgendarEntoncesEventoCreado() |
19 { | 17 { |
18 var adapter = new Mock<IGCalendarAdapter>(); | |
19 var message=""; | |
20 adapter.Setup(ad => ad.CreateEvent(It.IsAny<IGEventDetail>(), out message)).Returns(true); | |
21 | |
22 var publicador = new GooglePublicador(adapter.Object); | |
23 var agenda = new Agenda(publicador, DefaultEventoRepository, DefaultPersonaRepository); | |
20 | 24 |
25 agenda.Proponer("Agile Patterns", null, null, TipoEvento.Van); | |
26 adapter.Verify(ad => ad.CreateEvent(It.IsAny<IGEventDetail>(), out message), Times.Never()); | |
27 | |
28 agenda.Agendar("Agile Patterns", "Alejandro Labra", new DateTime(2011, 07, 09), "https://groups.google.com/d/topic/altnet-hispano/arYEMsPiAtY/discussion", TipoEvento.Van); | |
29 adapter.Verify(ad => ad.CreateEvent(It.IsAny<IGEventDetail>(), out message), Times.Once()); | |
21 } | 30 } |
22 | 31 |
23 /// <summary> | |
24 /// Validar que se halla creado IGEventDetail según detalles y tipo de evento (VAN, Café, Grupo estudio) | |
25 /// - Summary correcto, según tipo | |
26 /// - Summary con fecha en cultura es-ES | |
27 /// - Fecha de inicio y termino en Utc. | |
28 /// - Location | |
29 /// - Titulo según tipo | |
30 /// </summary> | |
31 [Test] | 32 [Test] |
32 public void CuandoPublicarEventoDadoTipoVanEntoncesDetalleCorrecto() | 33 public void CuandoPublicarEventoDadoTipoVanEntoncesDetalleCorrecto() |
33 { | 34 { |
34 var adapter = new Mock<IGCalendarAdapter>(); | 35 var adapter = new Mock<IGCalendarAdapter>(); |
35 var detail = new VanGEventDetail(); | 36 var detail = new VanGEventDetail(); |