Пример #1
0
        static void Main(string[] args)
        {
            // Service test calls
            IAccesoUPVService service = ServiceTest();

            // VPN test calls

            service.VPN_UPV.SetNameAuto();
            VPNTest(service.VPN_UPV);

            service.VPN_DSIC.SetNameAuto();
            VPNTest(service.VPN_DSIC);

            // Drive test calls

            Console.WriteLine("Press any key to start Drive testing...");
            Console.ReadKey();
            Console.Clear();

            try
            {
                if (!service.VPN_UPV.IsReachable())
                {
                    ConnectTest(service.VPN_UPV);
                }

                Console.Write("Type your user: "******"Press the drive letter: ");

                char letter = default;
                while (letter == default || !DriveLetterTools.IsValid(letter))
                {
                    if (letter != default)
                    {
                        Console.Write("Invalid input. Please try again: ");
                    }
                    letter = (char)Console.Read();
                    Console.WriteLine();
                }
                service.Disco_W.Letter = letter;

                Console.WriteLine("Type your domain:");
                foreach (var value in Enum.GetValues(typeof(UPVDomain)))
                {
                    Console.WriteLine($"{(int)value} - {(UPVDomain)value}");
                }
                Console.Write("Type here: ");
                service.Disco_W.Domain = (UPVDomain)int.Parse(Console.ReadLine());

                DriveTest(service.Disco_W);

                try
                {
                    Console.Write("Type your DSIC password: "******"DSIC Drive testing was canceled by the user.");
                };

                // Remote desktop test

                Console.WriteLine("Connecting to Linux Desktop...");
                RemoteDesktop.ConnectToLinuxDesktop();

                Console.WriteLine("Press any key when the Linux Desktop is closed");
                Console.ReadKey();

                Console.WriteLine("Connecting to Windows Desktop...");
                RemoteDesktop.ConnectToWindowsDesktop();

                Console.WriteLine("Press any key when the Windows Desktop is closed");
                Console.ReadKey();

                if (service.VPN_UPV.IsConnected)
                {
                    DisconnectTest(service.VPN_UPV);
                }
            }
            catch (OperationCanceledException)
            {
                Console.WriteLine("The VPN connection process was canceled by the user.\nDrive testing ended.");
            }

            Console.WriteLine("Press any key to exit...");
            Console.ReadKey();
        }
Пример #2
0
 public static void Assert_Connected(NetworkDrive drive)
 {
     Assert.IsTrue(drive.IsConnected);
     Assert.IsTrue(DriveLetterTools.IsValid(drive.ConnectedLetter));
     Assert.AreNotEqual(default, drive.ConnectedDriveLetter);