diff --git a/test/DynamoCoreWpfTests/ViewExtensions/GraphNodeManagerViewExtensionTests.cs b/test/DynamoCoreWpfTests/ViewExtensions/GraphNodeManagerViewExtensionTests.cs index a964df9eee3..331eaf28a93 100644 --- a/test/DynamoCoreWpfTests/ViewExtensions/GraphNodeManagerViewExtensionTests.cs +++ b/test/DynamoCoreWpfTests/ViewExtensions/GraphNodeManagerViewExtensionTests.cs @@ -22,6 +22,15 @@ namespace DynamoCoreWpfTests { public class GraphNodeManagerViewExtensionTests : DynamoTestUIBase { + protected override void GetLibrariesToPreload(List libraries) + { + libraries.Add("VMDataBridge.dll"); + libraries.Add("DesignScriptBuiltin.dll"); + libraries.Add("DSCoreNodes.dll"); + base.GetLibrariesToPreload(libraries); + } + + private string PackagesDirectory { get { return Path.Combine(GetTestDirectory(this.ExecutingDirectory), "pkgs"); } } protected override DynamoModel.IStartConfiguration CreateStartConfiguration(IPathResolver pathResolver) @@ -59,7 +68,6 @@ private void LoadExtension(GraphNodeManagerViewExtension v) [Test] public void ViewExtensionOpenTest() { - RaiseLoadedEvent(this.View); var extensionManager = View.viewExtensionManager; var viewExtension = extensionManager.ViewExtensions .FirstOrDefault(x => x as GraphNodeManagerViewExtension != null) @@ -82,7 +90,6 @@ public void ViewExtensionOpenTest() [Test] public void CorrectNumberNodeItemsTest() { - RaiseLoadedEvent(this.View); var extensionManager = View.viewExtensionManager; var viewExt = extensionManager.ViewExtensions .FirstOrDefault(x => x as GraphNodeManagerViewExtension != null) @@ -102,7 +109,6 @@ public void CorrectNumberNodeItemsTest() Open(@"pkgs\Dynamo Samples\extra\ZoomNodeColorStates.dyn"); hwm = this.ViewModel.CurrentSpace as HomeWorkspaceModel; - Utility.DispatcherUtil.DoEvents(); int loadedGraphNodes = hwm.Nodes.Count(); int loadedExtensionNodes = dataGridItems.Count; @@ -121,13 +127,13 @@ public void CorrectNumberNodeItemsTest() Assert.AreEqual(loadedGraphNodes, loadedExtensionNodes); Assert.AreEqual(deleteGraphNodes, deleteExtensionNodes); } + /// /// Test if using the IsFrozen filter yields correct results /// [Test] public void FilterFrozenItemsTest() { - RaiseLoadedEvent(this.View); var extensionManager = View.viewExtensionManager; var viewExt = extensionManager.ViewExtensions .FirstOrDefault(x => x as GraphNodeManagerViewExtension != null) @@ -136,8 +142,7 @@ public void FilterFrozenItemsTest() // Arrange LoadExtension(viewExt); - Open(@"pkgs\Dynamo Samples\extra\ZoomNodeColorStates.dyn"); - Utility.DispatcherUtil.DoEvents(); + OpenAndRun(@"pkgs\Dynamo Samples\extra\ZoomNodeColorStates.dyn"); // Get number of frozen Nodes in the graph var hwm = this.ViewModel.CurrentSpace as HomeWorkspaceModel; @@ -174,28 +179,23 @@ public void FilterFrozenItemsTest() [Test] public void ContainsEmptyListOrNullTest() { - RaiseLoadedEvent(this.View); var extensionManager = View.viewExtensionManager; var viewExt = extensionManager.ViewExtensions .FirstOrDefault(x => x as GraphNodeManagerViewExtension != null) as GraphNodeManagerViewExtension; - var hwm = this.ViewModel.CurrentSpace as HomeWorkspaceModel; - - // Arrange LoadExtension(viewExt); + var hwm = this.ViewModel.CurrentSpace as HomeWorkspaceModel; + var view = viewExt.ManagerView; - Open(@"pkgs\Dynamo Samples\extra\GraphNodeManagerTestGraph_NullsEmptyLists.dyn"); + OpenAndRun(@"pkgs\Dynamo Samples\extra\GraphNodeManagerTestGraph_NullsEmptyLists.dyn"); - hwm = this.ViewModel.CurrentSpace as HomeWorkspaceModel; - hwm.Run(); + var images = WpfUtilities.ChildrenOfType(view.NodesInfoDataGrid); Utility.DispatcherUtil.DoEvents(); - var images = WpfUtilities.ChildrenOfType(view.NodesInfoDataGrid); - int nullNodesImageCount = GetImageCount(images, "Null"); int emptyListNodesImageCount = GetImageCount(images, "EmptyList"); @@ -214,7 +214,6 @@ public void ContainsEmptyListOrNullTest() [Test] public void ViewExtensionOpensWithDynamoWhenRememberedTest() { - RaiseLoadedEvent(this.View); ViewModel.PreferenceSettings.EnablePersistExtensions = true; //assert that option is enabled @@ -247,7 +246,6 @@ public void ViewExtensionOpensWithDynamoWhenRememberedTest() [Test] public void ViewExtensionDoesNotOpensWithDynamoWhenClosedTest() { - RaiseLoadedEvent(this.View); ViewModel.PreferenceSettings.EnablePersistExtensions = true; //assert that option is enabled @@ -284,7 +282,6 @@ public void ViewExtensionDoesNotOpensWithDynamoWhenClosedTest() [Test] public void ViewExtensionDoesNotOpenWhenNotRememberedTest() { - RaiseLoadedEvent(this.View); ViewModel.PreferenceSettings.EnablePersistExtensions = false; //assert that option is disabled