コード例 #1
0
        static IAccesoUPVService ServiceTest()
        {
            Console.WriteLine("Creating Service...");
            IAccesoUPVService service = new AccesoUPVService();

            Console.WriteLine("Service created.");

            if (service.AreUninitializedSettings)
            {
                Console.WriteLine("--------- SERVICE TEST ---------");

                Console.WriteLine("There are uninitialized settings. These are:");

                StringBuilder builder = new StringBuilder();
                foreach (System.Configuration.SettingsPropertyValue setting in service.UninitializedSettings) // Loop through all strings
                {
                    builder.Append(" | ").Append(setting.Name.ToString());                                    // Append string to StringBuilder
                }
                Console.WriteLine(builder.ToString());                                                        // Get string from StringBuilder

                Console.WriteLine("\nPress any key to continue...");
                Console.ReadKey();

                Console.WriteLine("--------- SERVICE TEST ENDED ---------");
            }
            return(service);
        }
コード例 #2
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            AccesoUPVService service = new AccesoUPVService();
            MainWindow       window  = new MainWindow(service);

            window.Show();
        }
コード例 #3
0
        public void VPN_DSICCanBeConnected()
        {
            // Arrange
            IAccesoUPVService service = new AccesoUPVService();
            VPN vpn = service.VPN_DSIC;

            vpn.SetNameAuto();
            // Keep to disconnect in further testing
            VPN_DSIC = vpn;
            // Act and Assert
            ConnectionTests.CanBeConnected(vpn);
        }
コード例 #4
0
        public async Task WDriveCanBeConnectedAsync()
        {
            // Arrange
            IAccesoUPVService service = new AccesoUPVService();
            NetworkDrive      drive   = service.Disco_W;

            drive.Username = SharedData.Username;
            // Keep to disconnect in further testing
            WDrive = drive;
            // Act and Assert
            await ConnectionTestsAsync.CanBeConnectedAsync(drive);
        }
コード例 #5
0
        public async Task VPN_DSICCanBeConnectedAsync()
        {
            // Arrange
            IAccesoUPVService service = new AccesoUPVService();
            VPN vpn = service.VPN_DSIC;
            await vpn.SetNameAutoAsync();

            // Keep to disconnect in further testing
            VPN_DSIC = vpn;
            // Act and Assert
            await ConnectionTestsAsync.CanBeConnectedAsync(vpn);
        }
コード例 #6
0
        public Principal(AccesoUPVService service) : this()
        {
            _service = service;

            _service.VPN_UPV.SetNameAuto();
            _service.VPN_DSIC.SetNameAuto();

            this.Load        += InitVPN;
            this.FormClosing += DisconnectVPN;

            InitializeTextBoxes();
            InitializeConnectList();
        }
コード例 #7
0
        public void DSICDriveCanBeConnected()
        {
            // Arrange
            IAccesoUPVService service = new AccesoUPVService();
            NetworkDrive      drive   = service.Disco_DSIC;

            drive.Username = SharedData.Username;
            drive.Password = SharedData.DSICDrivePass;
            // Keep to disconnect in further testing
            DSICDrive = drive;
            // Act and Assert
            ConnectionTests.CanBeConnected(drive);
        }
コード例 #8
0
        public static void InitVPN(TestContext _)
        {
            // Arrange
            IAccesoUPVService service = new AccesoUPVService();
            VPN vpn = service.VPN_UPV;

            if (string.IsNullOrEmpty(vpn.Name))
            {
                vpn.SetNameAuto();
            }

            // Keep to disconnect in further testing
            VPN_UPV = vpn;

            // Disconnect any other VPNs
            DisconnectOtherVPNs(_);

            // Add VPN to list for others to disconnect it if it causes trouble for them
            SharedData.VPNs.Add(vpn);

            SharedData.PromptUsername();
        }