comparison Agendas/trunk/src/Agendas.Blog/Impl/PostWriterFactory.cs @ 99:3027c64344bd

agregado de llamadas a web service para crear posts en el blog de la comunidad agregado de tests sobre el publicador de blogs agregado de tests sobre el adapter del web service
author jorge.rowies
date Sat, 04 Jun 2011 22:33:05 -0300
parents a300394dbabe
children
comparison
equal deleted inserted replaced
98:4895116b8232 99:3027c64344bd
2 2
3 namespace Agendas.Blog.Impl 3 namespace Agendas.Blog.Impl
4 { 4 {
5 public class PostWriterFactory : IPostWriterFactory 5 public class PostWriterFactory : IPostWriterFactory
6 { 6 {
7 private readonly IPostWriterWebService _postWriterWebService;
8
9 public PostWriterFactory(IPostWriterWebService postWriterWebService)
10 {
11 _postWriterWebService = postWriterWebService;
12 }
13
7 public IPostWriter GetPostWriter(Accion accion) 14 public IPostWriter GetPostWriter(Accion accion)
8 { 15 {
9 switch (accion) 16 switch (accion)
10 { 17 {
11 case Accion.Agendar: 18 case Accion.Agendar:
12 return new AgendarReunionPostWriter(); 19 return new AgendarReunionPostWriter(_postWriterWebService);
13 case Accion.Publicar: 20 case Accion.Publicar:
14 return new PublicarReunionPostWriter(); 21 return new PublicarReunionPostWriter(_postWriterWebService);
15 default: 22 default:
16 return new NullObjectPostWriter(); 23 return new NullObjectPostWriter(_postWriterWebService);
17 } 24 }
18 } 25 }
19 } 26 }
20 } 27 }