column name and ordinal fix...tested on 10.1
[mono.git] / mcs / class / Mono.Posix / Test / Mono.Unix / UnixListenerTest.cs
1 // UnixListenerTest.cs: Unit tests for Mono.Unix.UnixListener
2 //
3 // Authors:
4 //  David Lechner (david@lechnology.com)
5 //
6 // (c) 2015 David Lechner
7 //
8
9 using System;
10 using System.IO;
11
12 using NUnit.Framework;
13 using Mono.Unix;
14
15 namespace MonoTests.Mono.Unix {
16
17     [TestFixture]
18     public class UnixListenerTest {
19
20         // test that a socket file is created and deleted by the UnixListener
21         [Test]
22         public void TestSocketFileCreateDelete ()
23         {
24             var socketFile = Path.GetTempFileName ();
25             // we just want the file name, not the file
26             File.Delete (socketFile);
27
28             using (var listener = new UnixListener (socketFile)) {
29                 // creating an instance of UnixListener should create the file
30                 Assert.IsTrue (File.Exists (socketFile), "#A01");
31             }
32             // and disposing the UnixListener should delete the file
33             Assert.IsFalse (File.Exists (socketFile), "#A02");
34         }
35     }
36 }