static void DisconnectTest(NetworkDrive drive) { Console.WriteLine("Press any key to disconnect..."); Console.ReadKey(); Console.WriteLine("Disconnecting..."); drive.Disconnect(); Console.WriteLine("Disconnected: {0}", !drive.IsConnected); }
internal static void CanBeDisconnected(NetworkDrive drive) { try { drive.Disconnect(); ConnectionAsserts.Assert_Disconnected(drive); } catch (OperationCanceledException) { ConnectionAsserts.Assert_Connected(drive); } }