2009-06-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
[mono.git] / mcs / class / System / Test / System.Net / HttpListenerTest.cs
index f541d01eead6e8df72997d06b1364a71a5297308..e1e70864c45c2fdcb9b7427901c318f9a8cd4192 100644 (file)
@@ -34,7 +34,11 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Net {
        [TestFixture]
+#if TARGET_JVM
+       [Ignore ("The class HttpListener is not implemented")]
+#endif
        public class HttpListenerTest {
+#if !TARGET_JVM
                [Test]
                public void DefaultProperties ()
                {
@@ -162,6 +166,27 @@ namespace MonoTests.System.Net {
                        listener.Close ();
                }
 
+               [Test]
+               public void StartStopStart ()
+               {
+                       HttpListener listener = new HttpListener ();
+                       listener.Prefixes.Add ("http://localhost:7777/hola/");
+                       listener.Start ();
+                       listener.Stop ();
+                       listener.Start ();
+                       listener.Close ();
+               }
+
+               [Test]
+               public void StartStopDispose ()
+               {
+                       using (HttpListener listener = new HttpListener ()){
+                               listener.Prefixes.Add ("http://localhost:7777/hola/");
+                               listener.Start ();
+                               listener.Stop ();
+                       }
+               }
+               
                [Test]
                public void AbortBeforeStart ()
                {
@@ -384,6 +409,7 @@ namespace MonoTests.System.Net {
                                Event.Close ();
                        }
                }
+#endif
        }
 }
 #endif