changeset 192:03cf6a377ee8

Se cambiaron algunos tests para que el Coverage dieran el 100%. NOTA: Si se utiliza el Atributo ExpectedException el coverage termina donde se dió la excepción. Mejor usar el Assert.Throws
author juanjose.montesdeocaarbos
date Wed, 10 Aug 2011 08:20:28 -0300
parents 49125b681709
children 523e3586b1c1
files Agendas/trunk/src/Agendas.Tests/AgendarTests.cs Agendas/trunk/src/Agendas.Tests/Blog/PostWriterWebServiceAdapterTests.cs
diffstat 2 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Tests/AgendarTests.cs	Tue Aug 09 08:55:08 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Tests/AgendarTests.cs	Wed Aug 10 08:20:28 2011 -0300
@@ -371,7 +371,7 @@
 		}
 
 		[Test]
-		[ExpectedException(typeof(AccionNoSoportadaException))]
+		//[ExpectedException(typeof(AccionNoSoportadaException))]
 		public void Al_confirmar_sin_agendar_debe_lanzarse_excepcion()
 		{
 			var publicador1 = new Mock<IPublicador>();
@@ -384,11 +384,11 @@
 
 			Assert.IsFalse(evento.Estado.GetType() == typeof(EventoAgendadoState));
 
-			agenda.Confirmar(evento.Id);
+			Assert.Throws<AccionNoSoportadaException>(()=>agenda.Confirmar(evento.Id));
 		}
 
 		[Test]
-		[ExpectedException(typeof(AccionNoSoportadaException))]
+		//[ExpectedException(typeof(AccionNoSoportadaException))]
 		public void Al_publicar_sin_confirmar_debe_lanzarse_excepcion()
 		{
 			const string urlWiki = "http://www.altnethispano.org/wiki/van-2010-10-21-mono-cecil.ashx";
@@ -402,7 +402,7 @@
 				DefaultEventoRepository.GetByState(EventoPropuestoState.GetInstance()).Single(e => e.Titulo == "Html 5");
 
 			Assert.IsFalse(evento.Estado.GetType() == typeof(EventoConfirmadoState));
-			agenda.Publicar(evento.Id, 1, urlWiki, duracion);
+			Assert.Throws<AccionNoSoportadaException>(() => agenda.Publicar(evento.Id, 1, urlWiki, duracion));
 		}
 
         [Test]
--- a/Agendas/trunk/src/Agendas.Tests/Blog/PostWriterWebServiceAdapterTests.cs	Tue Aug 09 08:55:08 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Tests/Blog/PostWriterWebServiceAdapterTests.cs	Wed Aug 10 08:20:28 2011 -0300
@@ -8,11 +8,11 @@
   public class PostWriterWebServiceAdapterTests
   {
     [Test]
-    [ExpectedException(typeof(EndpointNotFoundException))]
+    //[ExpectedException(typeof(EndpointNotFoundException))]
     public void Si_la_url_es_invalida_debe_lanzar_excepcion()
     {
       var srv = new PostWriterWebServiceAdapter(new BlogPublicadorConfig("http://dummy/dummy.aspx", "dummy", "dummy"));
-      srv.WriteBlogPost(null, null, null, false);
+      Assert.Throws<EndpointNotFoundException>(()=>srv.WriteBlogPost(null, null, null, false));
     }
   }