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); }
private void Application_Startup(object sender, StartupEventArgs e) { AccesoUPVService service = new AccesoUPVService(); MainWindow window = new MainWindow(service); window.Show(); }
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); }
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); }
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); }
public Principal(AccesoUPVService service) : this() { _service = service; _service.VPN_UPV.SetNameAuto(); _service.VPN_DSIC.SetNameAuto(); this.Load += InitVPN; this.FormClosing += DisconnectVPN; InitializeTextBoxes(); InitializeConnectList(); }
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); }
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(); }