comparison Agendas/trunk/src/Agendas.Google.Test/PublicadorTest.cs @ 138:62791999ad01

Agregando relaciĆ³n entre Evento y Patrocinador
author nelopauselli
date Thu, 28 Jul 2011 10:13:28 -0300
parents 80156ae1493f
children e6e6bfb1da9e
comparison
equal deleted inserted replaced
137:2d1adbaf0373 138:62791999ad01
18 var adapter = new Mock<IGCalendarAdapter>(); 18 var adapter = new Mock<IGCalendarAdapter>();
19 var message=""; 19 var message="";
20 adapter.Setup(ad => ad.CreateEvent(It.IsAny<IGEventDetail>(), out message)).Returns(true); 20 adapter.Setup(ad => ad.CreateEvent(It.IsAny<IGEventDetail>(), out message)).Returns(true);
21 21
22 var publicador = new GooglePublicador(adapter.Object); 22 var publicador = new GooglePublicador(adapter.Object);
23 var agenda = new Agenda(publicador, DefaultEventoRepository, DefaultPersonaRepository); 23 var agenda = new Agenda(publicador, DefaultEventoRepository, DefaultPersonaRepository, DefaultPatrocinadorRepository);
24 24
25 agenda.Proponer("Agile Patterns", null, null, TipoEvento.Van); 25 agenda.Proponer("Agile Patterns", null, null, TipoEvento.Van);
26 adapter.Verify(ad => ad.CreateEvent(It.IsAny<IGEventDetail>(), out message), Times.Never()); 26 adapter.Verify(ad => ad.CreateEvent(It.IsAny<IGEventDetail>(), out message), Times.Never());
27 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); 28 agenda.Agendar("Agile Patterns", "Alejandro Labra", new DateTime(2011, 07, 09), "https://groups.google.com/d/topic/altnet-hispano/arYEMsPiAtY/discussion", TipoEvento.Van);
34 { 34 {
35 var adapter = new Mock<IGCalendarAdapter>(); 35 var adapter = new Mock<IGCalendarAdapter>();
36 var detail = new VanGEventDetail(); 36 var detail = new VanGEventDetail();
37 37
38 var publicador = new GooglePublicador(adapter.Object); 38 var publicador = new GooglePublicador(adapter.Object);
39 var agenda = new Agenda(publicador, DefaultEventoRepository, DefaultPersonaRepository); 39 var agenda = new Agenda(publicador, DefaultEventoRepository, DefaultPersonaRepository, DefaultPatrocinadorRepository);
40 agenda.Proponer("Agile Patterns", null, null, TipoEvento.Van); 40 agenda.Proponer("Agile Patterns", null, null, TipoEvento.Van);
41 agenda.Agendar("Agile Patterns", "Alejandro Labra", new DateTime(2011, 07, 09), "https://groups.google.com/d/topic/altnet-hispano/arYEMsPiAtY/discussion", TipoEvento.Van); 41 agenda.Agendar("Agile Patterns", "Alejandro Labra", new DateTime(2011, 07, 09), "https://groups.google.com/d/topic/altnet-hispano/arYEMsPiAtY/discussion", TipoEvento.Van);
42 42
43 var ev = DefaultEventoRepository.GetActivos()[0]; 43 var ev = DefaultEventoRepository.GetActivos()[0];
44 detail.Generate(ev); 44 detail.Generate(ev);
70 { 70 {
71 var adapter = new Mock<IGCalendarAdapter>(); 71 var adapter = new Mock<IGCalendarAdapter>();
72 var detail = new CafeGEventDetail(); 72 var detail = new CafeGEventDetail();
73 73
74 var publicador = new GooglePublicador(adapter.Object); 74 var publicador = new GooglePublicador(adapter.Object);
75 var agenda = new Agenda(publicador, DefaultEventoRepository, DefaultPersonaRepository); 75 var agenda = new Agenda(publicador, DefaultEventoRepository, DefaultPersonaRepository, DefaultPatrocinadorRepository);
76 agenda.Proponer("Agile Patterns", null, null, TipoEvento.Cafe); 76 agenda.Proponer("Agile Patterns", null, null, TipoEvento.Cafe);
77 agenda.Agendar("Agile Patterns", "Alejandro Labra", new DateTime(2011, 07, 09), "https://groups.google.com/d/topic/altnet-hispano/arYEMsPiAtY/discussion", TipoEvento.Cafe); 77 agenda.Agendar("Agile Patterns", "Alejandro Labra", new DateTime(2011, 07, 09), "https://groups.google.com/d/topic/altnet-hispano/arYEMsPiAtY/discussion", TipoEvento.Cafe);
78 78
79 var ev = DefaultEventoRepository.GetActivos()[0]; 79 var ev = DefaultEventoRepository.GetActivos()[0];
80 detail.Generate(ev); 80 detail.Generate(ev);
106 { 106 {
107 var adapter = new Mock<IGCalendarAdapter>(); 107 var adapter = new Mock<IGCalendarAdapter>();
108 var detail = new EstudioGEventDetail(); 108 var detail = new EstudioGEventDetail();
109 109
110 var publicador = new GooglePublicador(adapter.Object); 110 var publicador = new GooglePublicador(adapter.Object);
111 var agenda = new Agenda(publicador, DefaultEventoRepository, DefaultPersonaRepository); 111 var agenda = new Agenda(publicador, DefaultEventoRepository, DefaultPersonaRepository, DefaultPatrocinadorRepository);
112 agenda.Proponer("Agile Patterns", null, null, TipoEvento.GrupoEstudio); 112 agenda.Proponer("Agile Patterns", null, null, TipoEvento.GrupoEstudio);
113 agenda.Agendar("Agile Patterns", "Alejandro Labra", new DateTime(2011, 07, 09), "https://groups.google.com/d/topic/altnet-hispano/arYEMsPiAtY/discussion", TipoEvento.GrupoEstudio); 113 agenda.Agendar("Agile Patterns", "Alejandro Labra", new DateTime(2011, 07, 09), "https://groups.google.com/d/topic/altnet-hispano/arYEMsPiAtY/discussion", TipoEvento.GrupoEstudio);
114 114
115 var ev = DefaultEventoRepository.GetActivos()[0]; 115 var ev = DefaultEventoRepository.GetActivos()[0];
116 detail.Generate(ev); 116 detail.Generate(ev);
143 var adapter = new Mock<IGCalendarAdapter>(); 143 var adapter = new Mock<IGCalendarAdapter>();
144 var message = ""; 144 var message = "";
145 adapter.Setup(ad => ad.DeleteEvent(It.IsAny<DateTime>(), It.IsAny<DateTime>(), out message)).Returns(true); 145 adapter.Setup(ad => ad.DeleteEvent(It.IsAny<DateTime>(), It.IsAny<DateTime>(), out message)).Returns(true);
146 146
147 var publicador = new GooglePublicador(adapter.Object); 147 var publicador = new GooglePublicador(adapter.Object);
148 var agenda = new Agenda(publicador, DefaultEventoRepository, DefaultPersonaRepository); 148 var agenda = new Agenda(publicador, DefaultEventoRepository, DefaultPersonaRepository, DefaultPatrocinadorRepository);
149 149
150 agenda.Proponer("Agile Patterns", null, null, TipoEvento.Van); 150 agenda.Proponer("Agile Patterns", null, null, TipoEvento.Van);
151 adapter.Verify(ad => ad.DeleteEvent(It.IsAny<DateTime>(), It.IsAny<DateTime>(), out message), Times.Never()); 151 adapter.Verify(ad => ad.DeleteEvent(It.IsAny<DateTime>(), It.IsAny<DateTime>(), out message), Times.Never());
152 152
153 agenda.Agendar("Agile Patterns", "Alejandro Labra", new DateTime(2011, 07, 09), "https://groups.google.com/d/topic/altnet-hispano/arYEMsPiAtY/discussion", TipoEvento.Van); 153 agenda.Agendar("Agile Patterns", "Alejandro Labra", new DateTime(2011, 07, 09), "https://groups.google.com/d/topic/altnet-hispano/arYEMsPiAtY/discussion", TipoEvento.Van);