public void CreateNetwork() { NetworkAction networkAction = new NetworkAction(DatabaseManager.ConnectionFor(dbName), newNetwork, true); networkAction.Completed += networkAction_Completed; networkAction.RunAsync(); AutoResetEvent.WaitOne(); DatabaseManager.ConnectionFor(dbName).LoadCache(DatabaseManager.ConnectionFor(dbName).Session); Assert.AreEqual(networks + 1, DatabaseManager.ConnectionFor(dbName).Cache.Networks.Length); }
public void CreateExternalNetwork() { Assert.True(DatabaseManager.ConnectionFor(dbName).Cache.PIFs.Length > 0); PIF pif = DatabaseManager.ConnectionFor(dbName).Cache.PIFs[0]; NetworkAction networkAction = new NetworkAction(DatabaseManager.ConnectionFor(dbName), newNetwork, pif, 2); networkAction.Completed += new System.EventHandler<System.EventArgs>(networkAction_Completed); networkAction.RunAsync(); AutoResetEvent.WaitOne(); DatabaseManager.RefreshCacheFor(dbName); Assert.AreEqual(networks + 1, DatabaseManager.ConnectionFor(dbName).Cache.Networks.Length); }
public void DeleteNetwork() { CreateNetwork(); Network network = FindCreatedNetwork(); Assert.NotNull(network); NetworkAction networkAction = new NetworkAction(DatabaseManager.ConnectionFor(dbName), network, false); networkAction.Completed += new System.EventHandler<System.EventArgs>(networkAction_Completed); networkAction.RunAsync(); AutoResetEvent.WaitOne(); DatabaseManager.RefreshCacheFor(dbName); Assert.AreEqual(networks, DatabaseManager.ConnectionFor(dbName).Cache.Networks.Length); }
private void DoRemoveNetwork() { if (SelectedVif != null) { VM vm = XenObject as VM; var action = new DeleteVIFAction(SelectedVif); action.Completed += action_Completed; action.RunAsync(); } else if(SelectedNetwork != null) { NetworkAction action = new NetworkAction(XenObject.Connection, SelectedNetwork,false); action.Completed += action_Completed; action.RunAsync(); } }
private void DoRemoveNetwork() { Program.MainWindow.AllowHistorySwitch = true; if (SelectedVif != null) { VM vm = XenObject as VM; var action = new DeleteVIFAction(SelectedVif); action.Completed += action_Completed; action.RunAsync(); } else if(SelectedNetwork != null) { NetworkAction action = new NetworkAction(XenObject.Connection, SelectedNetwork,false); action.Completed += action_Completed; action.RunAsync(); } }