1 // UnixListenerTest.cs: Unit tests for Mono.Unix.UnixListener
4 // David Lechner (david@lechnology.com)
6 // (c) 2015 David Lechner
12 using NUnit.Framework;
15 namespace MonoTests.Mono.Unix {
18 public class UnixListenerTest {
20 // test that a socket file is created and deleted by the UnixListener
22 public void TestSocketFileCreateDelete ()
24 var socketFile = Path.GetTempFileName ();
25 // we just want the file name, not the file
26 File.Delete (socketFile);
28 using (var listener = new UnixListener (socketFile)) {
29 // creating an instance of UnixListener should create the file
30 Assert.IsTrue (File.Exists (socketFile), "#A01");
32 // and disposing the UnixListener should delete the file
33 Assert.IsFalse (File.Exists (socketFile), "#A02");