Mercurial > altnet-hispano
diff Agendas/trunk/src/Agendas.Repositories.Tests/PatrocinadorEventoTests.cs @ 298:9bc60d166c8a
Se corrigieron los tests por el cambio de Patrocinador, para que no persista el logo en disco.
Se comentó el código de PatrocinadorApiController, que no se utiliza.
author | juanjose.montesdeocaarbos |
---|---|
date | Sun, 19 Feb 2012 16:00:38 -0300 |
parents | eeca9ddb330a |
children | 48ab8788bd19 |
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Repositories.Tests/PatrocinadorEventoTests.cs Sat Feb 18 15:27:26 2012 -0300 +++ b/Agendas/trunk/src/Agendas.Repositories.Tests/PatrocinadorEventoTests.cs Sun Feb 19 16:00:38 2012 -0300 @@ -1,5 +1,7 @@ using System; using System.Collections.Generic; +using System.Drawing; +using System.IO; using System.Linq; using System.Text; using Agendas.Repositories.Tests.Infraestructure; @@ -23,6 +25,16 @@ private Agenda _agenda; private readonly TestsHelper _testsHelper; + private static byte[] LoadLogo(string path) + { + using (var image = Image.FromFile(path)) + { + var ms = new MemoryStream(); + image.Save(ms, image.RawFormat); + return ms.ToArray(); + } + } + protected PatrocinadorEventoTests() { var infraestrutureFactory = new T(); @@ -68,8 +80,10 @@ private Guid CrearPatrocinador(string nombre, string images) { - var patrocinador = new Patrocinador(nombre); - patrocinador.LoadLogo(images); + var patrocinador = new Patrocinador(nombre) + { + Logo = LoadLogo(images) + }; using (_requestEmulator.Invoke()) { _patrocinadorRepository.Save(patrocinador);