From 210ee2bcbb35541572b4a55a2923335ef6d33375 Mon Sep 17 00:00:00 2001 From: pinzart90 Date: Fri, 3 May 2024 13:41:52 -0400 Subject: [PATCH] try out on more UI tests --- .../DynamoCoreWpfTests/AnnotationViewTests.cs | 6 +- .../ConnectorContextMenuTests.cs | 18 ++--- .../ConnectorViewModelTests.cs | 36 +++++----- .../ConverterViewModelTests.cs | 8 +-- test/DynamoCoreWpfTests/DynamoViewTests.cs | 8 +-- .../GeometryRegressionTests.cs | 4 +- test/DynamoCoreWpfTests/GroupStylesTests.cs | 6 +- test/DynamoCoreWpfTests/HomePageTests.cs | 32 ++++----- .../NodeAutoCompleteSearchTests.cs | 42 ++++++------ .../NodeViewCustomizationTests.cs | 50 +++++++------- test/DynamoCoreWpfTests/NodeViewTests.cs | 40 +++++------ test/DynamoCoreWpfTests/NoteViewTests.cs | 22 +++---- .../PackageManagerExtensionLoadingTests.cs | 8 +-- .../PackageManagerViewExtensionTests.cs | 16 ++--- test/DynamoCoreWpfTests/PackagePathTests.cs | 32 ++++----- .../PreferencesGeometryScalingTests.cs | 4 +- test/DynamoCoreWpfTests/PreviewBubbleTests.cs | 66 +++++++++---------- .../PythonNodeCustomizationTests.cs | 34 +++++----- test/DynamoCoreWpfTests/SecTabUITests.cs | 4 +- .../SliderViewModelTests.cs | 6 +- test/DynamoCoreWpfTests/SplashScreenTests.cs | 10 +-- test/DynamoCoreWpfTests/UnitsUITests.cs | 22 +++---- .../Utility/NodeContextMenuBuilderTests.cs | 12 ++-- .../DocumentationBrowserViewExtensionTests.cs | 58 ++++++++-------- .../GraphMetadataViewExtensionTests.cs | 10 +-- .../GraphNodeManagerViewExtensionTests.cs | 14 ++-- .../NodeAutoCompleteViewExtensionTests.cs | 4 +- .../NodeManipulatorExtensionTests.cs | 4 +- .../NotificationsExtensionTests.cs | 4 +- .../ViewExtensions/ViewExtensionTests.cs | 26 ++++---- .../WorkspaceDependencyViewExtensionTests.cs | 28 ++++---- .../LibraryViewControllerTests.cs | 6 +- 32 files changed, 320 insertions(+), 320 deletions(-) diff --git a/test/DynamoCoreWpfTests/AnnotationViewTests.cs b/test/DynamoCoreWpfTests/AnnotationViewTests.cs index 18c963b9b66..5493fcd4fef 100644 --- a/test/DynamoCoreWpfTests/AnnotationViewTests.cs +++ b/test/DynamoCoreWpfTests/AnnotationViewTests.cs @@ -56,7 +56,7 @@ protected override void GetLibrariesToPreload(List libraries) base.GetLibrariesToPreload(libraries); } - [Test] + [TestOnSeparateThread] public void TestAnnotationMouseClickEvent() { Open(@"UI\GroupTest.dyn"); @@ -73,7 +73,7 @@ public void TestAnnotationMouseClickEvent() Assert.AreEqual(2, DynamoSelection.Instance.Selection.Count()); } - [Test] + [TestOnSeparateThread] public void TestAnnotationOnDummyNodes() { Open(@"UI\GroupDummyNodes.dyn"); @@ -90,7 +90,7 @@ public void TestAnnotationOnDummyNodes() Assert.AreEqual(1,modelCount); } - [Test] + [TestOnSeparateThread] public void UngroupingCollapsedGroupWillUnCollapseAllGroupContent() { // Arrange diff --git a/test/DynamoCoreWpfTests/ConnectorContextMenuTests.cs b/test/DynamoCoreWpfTests/ConnectorContextMenuTests.cs index 66724068295..418f0ae12ef 100644 --- a/test/DynamoCoreWpfTests/ConnectorContextMenuTests.cs +++ b/test/DynamoCoreWpfTests/ConnectorContextMenuTests.cs @@ -12,7 +12,7 @@ namespace DynamoCoreWpfTests { public class ConnectorContextMenuTests: DynamoTestUIBase { - [Test] + [TestOnSeparateThread] public void ConstructingContextMenuTest() { Open(@"UI/ConnectorContextMenuTestFile.dyn"); @@ -32,7 +32,7 @@ public void ConstructingContextMenuTest() Assert.AreEqual(connectorViewModel.MousePosition, contextMenuViewModel.CurrentPosition); } - [Test] + [TestOnSeparateThread] public void SetContextMenuToNullAfterUseTest() { Open(@"UI/ConnectorContextMenuTestFile.dyn"); @@ -46,7 +46,7 @@ public void SetContextMenuToNullAfterUseTest() //Assert property on ConnectorViewModel is set to null. Assert.IsNull(connectorViewModel.ConnectorContextMenuViewModel); } - [Test] + [TestOnSeparateThread] public void BreakConnectionFromContextMenuTest() { Open(@"UI/ConnectorContextMenuTestFile.dyn"); @@ -63,7 +63,7 @@ public void BreakConnectionFromContextMenuTest() //Assert that the only connector in the model has been destroyed. Assert.AreEqual(connectorCount-1, updatedConnectorCount); } - [Test] + [TestOnSeparateThread] public void SelectedConnectedFromContextMenuTest() { Open(@"UI/ConnectorContextMenuTestFile.dyn"); @@ -78,7 +78,7 @@ public void SelectedConnectedFromContextMenuTest() //Assert that the selection of the two adjacent nodes is accurate. Assert.AreEqual(DynamoSelection.Instance.Selection.Count, initialSelectedCount + 2); } - [Test] + [TestOnSeparateThread] public void HideConnectorFromContextMenuTest() { Open(@"UI/ConnectorContextMenuTestFile.dyn"); @@ -94,7 +94,7 @@ public void HideConnectorFromContextMenuTest() } - [Test] + [TestOnSeparateThread] public void AreNodeConnectionsInMenu() { // Mock a WorkspaceView @@ -107,7 +107,7 @@ public void AreNodeConnectionsInMenu() Assert.AreEqual(contextMenu.Items.Count, 2); } - [Test] + [TestOnSeparateThread] public void ShowAllConnectorFromWorkspaceContextMenuTest() { Open(@"UI/ConnectorShowHideAllWires.dyn"); @@ -134,7 +134,7 @@ public void ShowAllConnectorFromWorkspaceContextMenuTest() Assert.AreEqual(4, hiddenConnectors.Count()); } - [Test] + [TestOnSeparateThread] public void GoToStartNodeTest() { Open(@"UI/ConnectorContextMenuTestFile.dyn"); @@ -149,7 +149,7 @@ public void GoToStartNodeTest() Assert.AreEqual(connectorViewModel.ConnectorModel.Start.Owner.IsSelected, true); } - [Test] + [TestOnSeparateThread] public void GoToEndNodeTest() { Open(@"UI/ConnectorContextMenuTestFile.dyn"); diff --git a/test/DynamoCoreWpfTests/ConnectorViewModelTests.cs b/test/DynamoCoreWpfTests/ConnectorViewModelTests.cs index 6fe6070e1f7..829d119d22e 100644 --- a/test/DynamoCoreWpfTests/ConnectorViewModelTests.cs +++ b/test/DynamoCoreWpfTests/ConnectorViewModelTests.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Dynamo.Selection; using NUnit.Framework; using static Dynamo.Models.DynamoModel; @@ -17,7 +17,7 @@ public class ConnectorViewModelTests : DynamoTestUIBase /// /// Check to see if a connector is visible after pre 2.13 graph open /// - [Test] + [TestOnSeparateThread] public void ConnectorVisibilityForLegacyGraphTest() { Open(@"UI/ConnectorPinTests.dyn"); @@ -31,7 +31,7 @@ public void ConnectorVisibilityForLegacyGraphTest() /// /// Check to see a connector is visible after xml graph open /// - [Test] + [TestOnSeparateThread] public void ConnectorVisibilityForLegacyXMLGraphTest() { var filePath = @"UI/UI_visual_test.dyn"; @@ -50,7 +50,7 @@ public void ConnectorVisibilityForLegacyXMLGraphTest() /// /// Check to see a pin can be added to a connector /// - [Test] + [TestOnSeparateThread] public void CanPinConnector() { Open(@"UI/ConnectorPinTests.dyn"); @@ -80,7 +80,7 @@ public void CanPinConnector() /// /// Check to see a pin can be removed from a connector /// - [Test] + [TestOnSeparateThread] public void CanUnPinFromConnector() { Open(@"UI/ConnectorPinTests.dyn"); @@ -107,7 +107,7 @@ public void CanUnPinFromConnector() /// /// Check to see if can select connected nodes. /// - [Test] + [TestOnSeparateThread] public void CanSelectConnectedNodes() { Open(@"UI/ConnectorPinTests.dyn"); @@ -122,7 +122,7 @@ public void CanSelectConnectedNodes() /// /// Check to see if can break connection. /// - [Test] + [TestOnSeparateThread] public void CanBreakConnection() { Open(@"UI/ConnectorPinTests.dyn"); @@ -138,7 +138,7 @@ public void CanBreakConnection() /// a command that toggles between 'IsVisible' and '!IsVisible'. So this test /// verifies that this works as expected. /// - [Test] + [TestOnSeparateThread] public void CanHideConnector() { Open(@"UI/ConnectorPinTests.dyn"); @@ -153,7 +153,7 @@ public void CanHideConnector() /// Check to see if can unhide connector. 'HideConnection' toggles the visibility /// of the wire, so calling it twice should unhide the connector. /// - [Test] + [TestOnSeparateThread] public void CanUnhideConnector() { Open(@"UI/ConnectorPinTests.dyn"); @@ -170,7 +170,7 @@ public void CanUnhideConnector() /// /// Can place WatchNode where specified along a connector /// - [Test] + [TestOnSeparateThread] public void CanPlaceWatchNode() { Open(@"UI/ConnectorPinTests.dyn"); @@ -192,7 +192,7 @@ public void CanPlaceWatchNode() /// Assert that a watch node is placed on the correct connector, /// and that it rewires new wires to the correct startind/ending ports. /// - [Test] + [TestOnSeparateThread] public void PlaceWatchNodeAndRewireCorrectly() { Open(@"UI/WatchNodePlacement.dyn"); @@ -244,7 +244,7 @@ public void PlaceWatchNodeAndRewireCorrectly() /// This occurs when a watch node is placed. New connectors are created and the old pin /// locations are used to place new pins where the old ones were. /// - [Test] + [TestOnSeparateThread] public void PinPlacedOnCorrectWireToWatchNode() { Open(@"UI/WatchNodePlacement.dyn"); @@ -293,7 +293,7 @@ public void PinPlacedOnCorrectWireToWatchNode() /// /// Can undo 'placepin' command. /// - [Test] + [TestOnSeparateThread] public void CanUndoPin() { Open(@"UI/ConnectorPinTests.dyn"); @@ -318,7 +318,7 @@ public void CanUndoPin() /// /// Can undo 'Unpin' command /// - [Test] + [TestOnSeparateThread] public void CanUndoUnpin() { Open(@"UI/ConnectorPinTests.dyn"); @@ -347,7 +347,7 @@ public void CanUndoUnpin() /// /// Can undo 'delete pin' command. /// - [Test] + [TestOnSeparateThread] public void CanUndoDeletePin() { Open(@"UI/ConnectorPinTests.dyn"); @@ -376,7 +376,7 @@ public void CanUndoDeletePin() /// /// Can undo 'drag pin'. /// - [Test] + [TestOnSeparateThread] public void CanUndoDragPin() { Open(@"UI/ConnectorPinTests.dyn"); @@ -431,7 +431,7 @@ public void CanUndoDragPin() Assert.AreEqual(initialY, connectorPin.CenterY); } - [Test] + [TestOnSeparateThread] public void CanUndoPlaceWatchNode() { Open(@"UI/WatchNodePlacement.dyn"); @@ -457,4 +457,4 @@ public void CanUndoPlaceWatchNode() } #endregion } -} \ No newline at end of file +} diff --git a/test/DynamoCoreWpfTests/ConverterViewModelTests.cs b/test/DynamoCoreWpfTests/ConverterViewModelTests.cs index 0363b2d854c..97c57a141b2 100644 --- a/test/DynamoCoreWpfTests/ConverterViewModelTests.cs +++ b/test/DynamoCoreWpfTests/ConverterViewModelTests.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Windows.Controls; using CoreNodeModels; @@ -46,7 +46,7 @@ protected override void GetLibrariesToPreload(List libraries) /// public ConversionUnit SelectedToConversion /// private void model_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) /// - [Test] + [TestOnSeparateThread] public void ConverterViewModel_LengthInchesToCentimetersTest() { float inchesToCmFactor = (float)2.54; @@ -85,7 +85,7 @@ public void ConverterViewModel_LengthInchesToCentimetersTest() /// public bool IsSelectionFromBoxEnabled /// public string SelectionFromBoxToolTip /// - [Test] + [TestOnSeparateThread] public void ConverterViewModel_TooltipTest() { float inchesToCmFactor = (float)2.54; @@ -128,7 +128,7 @@ public void ConverterViewModel_TooltipTest() /// public List SelectedFromConversionSource /// public List SelectedToConversionSource /// - [Test] + [TestOnSeparateThread] public void ConverterViewModel_ItemsSourceCentimetersToMetersTest() { Open(@"core\library\converterNodeTest.dyn"); diff --git a/test/DynamoCoreWpfTests/DynamoViewTests.cs b/test/DynamoCoreWpfTests/DynamoViewTests.cs index 66f57f02e8c..ea1c1688ddd 100644 --- a/test/DynamoCoreWpfTests/DynamoViewTests.cs +++ b/test/DynamoCoreWpfTests/DynamoViewTests.cs @@ -40,7 +40,7 @@ protected override void GetLibrariesToPreload(List libraries) libraries.Add("FFITarget.dll"); } - [Test] + [TestOnSeparateThread] public void FooterNotificationControlTest() { // Arrange @@ -95,7 +95,7 @@ public void FooterNotificationControlTest() Assert.AreEqual((items[1] as FooterNotificationItem).NotificationCount, 0); } - [Test] + [TestOnSeparateThread] public void OpeningWorkspaceWithTclsrustWarning() { // Open workspace with test mode as false, to verify trust warning. @@ -112,7 +112,7 @@ public void OpeningWorkspaceWithTclsrustWarning() DynamoModel.IsTestMode = true; } - [Test] + [TestOnSeparateThread] public void ElementBinding_SaveAs() { var prebindingPathInTestDir = @"core\callsite\trace_test-prebinding.dyn"; @@ -155,7 +155,7 @@ public void ElementBinding_SaveAs() File.Delete(saveAsPath); } - [Test] + [TestOnSeparateThread] public void TestToastNotificationClosingBehavior() { var preferencesWindow = new PreferencesView(View); diff --git a/test/DynamoCoreWpfTests/GeometryRegressionTests.cs b/test/DynamoCoreWpfTests/GeometryRegressionTests.cs index 6c6714be906..7611ea60832 100644 --- a/test/DynamoCoreWpfTests/GeometryRegressionTests.cs +++ b/test/DynamoCoreWpfTests/GeometryRegressionTests.cs @@ -1,4 +1,4 @@ -using Dynamo.Scheduler; +using Dynamo.Scheduler; using Dynamo.Wpf.ViewModels.Core; using NUnit.Framework; using System; @@ -34,7 +34,7 @@ protected override void GetLibrariesToPreload(List libraries) /// 2. An error with the transpose built-in method when it received a combination of empty /// arrays and scalars, resulting in a crash. /// - [Test] + [TestOnSeparateThread] public void DeletingNodesShouldNotMakeTransposeFailCausingCrash() { TaskStateChangedEventHandler evaluationDidNotFailHandler = diff --git a/test/DynamoCoreWpfTests/GroupStylesTests.cs b/test/DynamoCoreWpfTests/GroupStylesTests.cs index bf32ccfa21a..79f8d87565a 100644 --- a/test/DynamoCoreWpfTests/GroupStylesTests.cs +++ b/test/DynamoCoreWpfTests/GroupStylesTests.cs @@ -50,7 +50,7 @@ protected override void GetLibrariesToPreload(List libraries) /// /// Validates that the GroupStyles in the PreferencesView match the ones in the AnnotationView /// - [Test] + [TestOnSeparateThread] public void TestDefaultGroupStyles_PreferencesView() { int defaultGroupStylesCounter = 4; @@ -79,7 +79,7 @@ public void TestDefaultGroupStyles_PreferencesView() /// /// Add a new GroupStyle and validates that the GroupStyles in the PreferencesView match the ones in the AnnotationView /// - [Test] + [TestOnSeparateThread] public void TestAddGroupStyle_ContextMenu() { int currentGroupStylesCounter = 5; @@ -121,7 +121,7 @@ public void TestAddGroupStyle_ContextMenu() } - [Test] + [TestOnSeparateThread] public void CustomColorPicker_PrePopulateDefaultColors() { Open(@"UI\GroupTest.dyn"); diff --git a/test/DynamoCoreWpfTests/HomePageTests.cs b/test/DynamoCoreWpfTests/HomePageTests.cs index 079f1af90b2..ebb77263bcc 100644 --- a/test/DynamoCoreWpfTests/HomePageTests.cs +++ b/test/DynamoCoreWpfTests/HomePageTests.cs @@ -18,7 +18,7 @@ namespace DynamoCoreWpfTests internal class HomePageTests : DynamoTestUIBase { #region initialization tests - [Test] + [TestOnSeparateThread] public void GuidedTourItems_InitializationShouldContainExpectedItems() { // Arrange @@ -34,7 +34,7 @@ public void GuidedTourItems_InitializationShouldContainExpectedItems() Assert.AreEqual(Dynamo.Wpf.Properties.Resources.PackagesGuide.TrimStart('_'), homePage.GuidedTourItems[2].Name); } - [Test] + [TestOnSeparateThread] public void ActionDelegates_ShouldBeProperlySetAfterConstruction() { // Arrange @@ -115,7 +115,7 @@ internal static string CONTAINER_ITEM_CLICK_SCRIPT(string elementId) } - [Test] + [TestOnSeparateThread] [Ignore("IsNewAppHomeEnabled flag is set to false")] public void CanClickRecentGraph() { @@ -156,7 +156,7 @@ public void CanClickRecentGraph() Assert.IsTrue(windoClosed, "Dynamo View was not closed correctly."); } - [Test] + [TestOnSeparateThread] [Ignore("IsNewAppHomeEnabled flag is set to false")] public void CanClickSampleGraph() { @@ -202,7 +202,7 @@ public void CanClickSampleGraph() Assert.IsTrue(windoClosed, "Dynamo View was not closed correctly."); } - [Test] + [TestOnSeparateThread] [Ignore("IsNewAppHomeEnabled flag is set to false")] public void CanClickTourGuide() { @@ -237,7 +237,7 @@ public void CanClickTourGuide() Assert.IsTrue(windoClosed, "Dynamo View was not closed correctly."); } - [Test] + [TestOnSeparateThread] [Ignore("IsNewAppHomeEnabled flag is set to false")] public void ReceiveCorrectNumberOfRecentGrphs() { @@ -267,7 +267,7 @@ public void ReceiveCorrectNumberOfRecentGrphs() Assert.IsTrue(windoClosed, "Dynamo View was not closed correctly."); } - [Test] + [TestOnSeparateThread] [Ignore("IsNewAppHomeEnabled flag is set to false")] public void ReceiveCorrectNumberOfSamples() { @@ -304,7 +304,7 @@ public void ReceiveCorrectNumberOfSamples() Assert.IsTrue(windoClosed, "Dynamo View was not closed correctly."); } - [Test] + [TestOnSeparateThread] [Ignore("IsNewAppHomeEnabled flag is set to false")] public void ReceiveCorrectNumberOfTourGuides() { @@ -325,7 +325,7 @@ public void ReceiveCorrectNumberOfTourGuides() Assert.IsTrue(windoClosed, "Dynamo View was not closed correctly."); } - [Test] + [TestOnSeparateThread] [Ignore("IsNewAppHomeEnabled flag is set to false")] public void ReceiveCorrectNumberOfCarouselVideos() { @@ -346,7 +346,7 @@ public void ReceiveCorrectNumberOfCarouselVideos() Assert.IsTrue(windoClosed, "Dynamo View was not closed correctly."); } - [Test] + [TestOnSeparateThread] [Ignore("IsNewAppHomeEnabled flag is set to false")] public void CanRunNewHomeWorkspaceCommandFromHomePage() { @@ -384,7 +384,7 @@ void Model_WorkspaceCleared(WorkspaceModel model) Assert.IsTrue(windoClosed, "Dynamo View was not closed correctly."); } - [Test] + [TestOnSeparateThread] [Ignore("IsNewAppHomeEnabled flag is set to false")] public void CanRunNewCustomNodeCommandFromHomePage() { @@ -417,7 +417,7 @@ public void CanRunNewCustomNodeCommandFromHomePage() Assert.IsTrue(windoClosed, "Dynamo View was not closed correctly."); } - [Test] + [TestOnSeparateThread] [Ignore("IsNewAppHomeEnabled flag is set to false")] public void CanOpenWorkspaceCommandFromHomePage() { @@ -450,7 +450,7 @@ public void CanOpenWorkspaceCommandFromHomePage() Assert.IsTrue(windoClosed, "Dynamo View was not closed correctly."); } - [Test] + [TestOnSeparateThread] [Ignore("IsNewAppHomeEnabled flag is set to false")] public void ShowTemplateCommandFromHomePage() { @@ -484,7 +484,7 @@ public void ShowTemplateCommandFromHomePage() Assert.IsTrue(windoClosed, "Dynamo View was not closed correctly."); } - [Test] + [TestOnSeparateThread] [Ignore("IsNewAppHomeEnabled flag is set to false")] public void ShowBackupFolderCommandFromHomePage() { @@ -517,7 +517,7 @@ public void ShowBackupFolderCommandFromHomePage() Assert.IsTrue(windoClosed, "Dynamo View was not closed correctly."); } - [Test] + [TestOnSeparateThread] [Ignore("IsNewAppHomeEnabled flag is set to false")] public void ShowSampleFilesFolderCommandFromHomePage() { @@ -548,7 +548,7 @@ public void ShowSampleFilesFolderCommandFromHomePage() Assert.IsTrue(windoClosed, "Dynamo View was not closed correctly."); } - [Test] + [TestOnSeparateThread] [Ignore("IsNewAppHomeEnabled flag is set to false")] public void CanOpenGraphOnDragAndDrop() { diff --git a/test/DynamoCoreWpfTests/NodeAutoCompleteSearchTests.cs b/test/DynamoCoreWpfTests/NodeAutoCompleteSearchTests.cs index d5784464d62..6082bee3509 100644 --- a/test/DynamoCoreWpfTests/NodeAutoCompleteSearchTests.cs +++ b/test/DynamoCoreWpfTests/NodeAutoCompleteSearchTests.cs @@ -63,7 +63,7 @@ public override void Start() Model.AddZeroTouchNodesToSearch(Model.LibraryServices.GetAllFunctionGroups()); } - [Test] + [TestOnSeparateThread] public void NodeSuggestions_CanAutoCompleteInCustomNodeWorkspace() { Open(@"pkgs\EvenOdd2\dyf\EvenOdd.dyf"); @@ -96,7 +96,7 @@ public void NodeSuggestions_CanAutoCompleteInCustomNodeWorkspace() Assert.IsTrue(currentWs.NodeAutoCompleteSearchBar.IsOpen); } - [Test] + [TestOnSeparateThread] public void NodeSuggestions_CanAutoCompleteOnCustomNodes() { Open(@"UI\builtin_inputport_suggestion.dyn"); @@ -122,7 +122,7 @@ public void NodeSuggestions_CanAutoCompleteOnCustomNodes() Assert.AreEqual(8, searchViewModel.FilteredResults.Count()); } - [Test] + [TestOnSeparateThread] public void NodeSuggestions_CanAutoCompleteOnCustomNodesOutPort() { Open(@"UI\builtin_inputport_suggestion.dyn"); @@ -148,7 +148,7 @@ public void NodeSuggestions_CanAutoCompleteOnCustomNodesOutPort() Assert.AreEqual(10, searchViewModel.FilteredResults.Count()); } - [Test] + [TestOnSeparateThread] public void NodeSuggestions_CanAutoCompleteOnCustomNodesOutPort_WithSpaceInPortName() { var outputNode = new Dynamo.Graph.Nodes.CustomNodes.Output(); @@ -168,7 +168,7 @@ public void NodeSuggestions_CanAutoCompleteOnCustomNodesOutPort_WithSpaceInPortN searchViewModel.PopulateAutoCompleteCandidates(); Assert.AreEqual(58, searchViewModel.FilteredResults.Count()); } - [Test] + [TestOnSeparateThread] public void NodeSuggestions_CanAutoCompleteOnCustomNodesOutPort_WithWhiteSpaceStartingPortName() { var outputNode = new Dynamo.Graph.Nodes.CustomNodes.Output(); @@ -189,7 +189,7 @@ public void NodeSuggestions_CanAutoCompleteOnCustomNodesOutPort_WithWhiteSpaceSt Assert.AreEqual(58, searchViewModel.FilteredResults.Count()); } - [Test] + [TestOnSeparateThread] public void NodeSuggestions_InputPortZeroTouchNode_AreCorrect() { Open(@"UI\ffitarget_inputport_suggestion.dyn"); @@ -234,7 +234,7 @@ public void NodeSuggestions_InputPortZeroTouchNode_AreCorrect() Assert.IsFalse(currentWs.NodeAutoCompleteSearchBar.IsOpen); } - [Test] + [TestOnSeparateThread] public void NodeSuggestions_InputPortZeroTouchNodeForProperty_AreCorrect() { Open(@"UI\ffitarget_property_inputport_suggestion.dyn"); @@ -263,7 +263,7 @@ public void NodeSuggestions_InputPortZeroTouchNodeForProperty_AreCorrect() Assert.IsTrue(expectedNodes.SequenceEqual(suggestedNodes)); } - [Test] + [TestOnSeparateThread] public void NodeSuggestions_GeometryNodes_SortedBy_NodeGroup_CreateActionQuery() { var type1 = Model.SearchModel.Entries.Where(x => x.FullName.Contains("DummyPoint.DirectionTo")).FirstOrDefault(); //returns a dummyPoint. @@ -281,7 +281,7 @@ public void NodeSuggestions_GeometryNodes_SortedBy_NodeGroup_CreateActionQuery() Assert.AreEqual(SearchElementGroup.Query, suggestions.LastOrDefault().Group); } - [Test] + [TestOnSeparateThread] public void NodeSuggestions_InputPortBuiltInNode_AreCorrect() { Open(@"UI\builtin_inputport_suggestion.dyn"); @@ -306,7 +306,7 @@ public void NodeSuggestions_InputPortBuiltInNode_AreCorrect() Assert.AreEqual(0, suggestions.Count()); } - [Test] + [TestOnSeparateThread] public void NodeSuggestions_OutputPortBuiltInNode_AreCorrect() { Open(@"UI\builtin_outputport_suggestion.dyn"); @@ -329,7 +329,7 @@ public void NodeSuggestions_OutputPortBuiltInNode_AreCorrect() Assert.AreEqual(58, suggestions.Count()); } - [Test] + [TestOnSeparateThread] public void NodeSuggestions_MultipleOutputPortCBN_AreCorrect() { Open(@"UI\builtin_outputport_CBNsuggestion.dyn"); @@ -352,7 +352,7 @@ public void NodeSuggestions_MultipleOutputPortCBN_AreCorrect() Assert.AreEqual(outPorts[2].PortModel.Index, connector.ConnectorModel.Start.Index); } - [Test] + [TestOnSeparateThread] public void NodeSearchElementComparerSortsBasedOnTypeDistance() { var core = Model.LibraryServices.LibraryManagementCore; @@ -365,7 +365,7 @@ public void NodeSearchElementComparerSortsBasedOnTypeDistance() Assert.AreEqual(-1, comparer.Compare(type1, type2)); } - [Test] + [TestOnSeparateThread] public void NodeSearchElementComparerSortsBasedOnTypeDistance_NonExact() { var core = Model.LibraryServices.LibraryManagementCore; @@ -378,7 +378,7 @@ public void NodeSearchElementComparerSortsBasedOnTypeDistance_NonExact() Assert.AreEqual(1, comparer.Compare(type1, type2)); } - [Test] + [TestOnSeparateThread] public void NodeSearchElementComparerSortsBasedOnTypeDistance_MultiReturnNodeModel() { var core = Model.LibraryServices.LibraryManagementCore; @@ -394,7 +394,7 @@ public void NodeSearchElementComparerSortsBasedOnTypeDistance_MultiReturnNodeMod Assert.AreEqual(-1, comparer.Compare(type1, type2)); } - [Test] + [TestOnSeparateThread] public void NodeSearchElementComparerSortsBasedOnTypeDistance_MultiReturnNodeModelEqual() { var core = Model.LibraryServices.LibraryManagementCore; @@ -410,7 +410,7 @@ public void NodeSearchElementComparerSortsBasedOnTypeDistance_MultiReturnNodeMod Assert.AreEqual(0, comparer.Compare(type1, type2)); } - [Test] + [TestOnSeparateThread] public void NodeSuggestionsAreSortedBasedOnGroupAndAlphabetically() { Open(@"UI\builtin_inputport_suggestion.dyn"); @@ -444,7 +444,7 @@ public void NodeSuggestionsAreSortedBasedOnGroupAndAlphabetically() } - [Test] + [TestOnSeparateThread] public void NodeSuggestions_DefaultSuggestions() { Open(@"UI\builtin_inputport_suggestion.dyn"); @@ -474,7 +474,7 @@ public void NodeSuggestions_DefaultSuggestions() Assert.AreEqual("String", searchViewModel.FilteredResults.FirstOrDefault().Name); } - [Test] + [TestOnSeparateThread] public void SearchNodeAutocompletionSuggestions() { Open(@"UI\builtin_inputport_suggestion.dyn"); @@ -500,7 +500,7 @@ public void SearchNodeAutocompletionSuggestions() Assert.AreEqual(5 , searchViewModel.FilteredResults.Count()); } - [Test] + [TestOnSeparateThread] public void CloseNodeAutocompleteWhenParentNodeDeleted() { Open(@"UI\builtin_inputport_suggestion.dyn"); @@ -531,7 +531,7 @@ public void CloseNodeAutocompleteWhenParentNodeDeleted() } - [Test] + [TestOnSeparateThread] public void NodeSuggestions_SkippedSuggestions() { Open(@"UI\builtin_inputport_suggestion.dyn"); @@ -561,7 +561,7 @@ public void NodeSuggestions_SkippedSuggestions() Assert.AreEqual("Number Slider", searchViewModel.FilteredResults.FirstOrDefault().Name); } - [Test] + [TestOnSeparateThread] public void NoMLAutocompleteRecommendations() { Open(@"UI\builtin_inputport_suggestion.dyn"); diff --git a/test/DynamoCoreWpfTests/NodeViewCustomizationTests.cs b/test/DynamoCoreWpfTests/NodeViewCustomizationTests.cs index 7d3ceabbba1..2f73e64c0c1 100644 --- a/test/DynamoCoreWpfTests/NodeViewCustomizationTests.cs +++ b/test/DynamoCoreWpfTests/NodeViewCustomizationTests.cs @@ -57,7 +57,7 @@ public void Watch3DHasViewer() Assert.NotNull(watchView); } - [Test] + [TestOnSeparateThread] public void StringInputHasTextboxAndCorrectValue() { Open(@"UI\CoreUINodes.dyn"); @@ -67,7 +67,7 @@ public void StringInputHasTextboxAndCorrectValue() Assert.AreEqual("\"ok\"", element.Text); } - [Test] + [TestOnSeparateThread] public void BoolSelectorHasRadioButtonsAndProperlySetValues() { Open(@"UI\CoreUINodes.dyn"); @@ -81,7 +81,7 @@ public void BoolSelectorHasRadioButtonsAndProperlySetValues() Assert.AreEqual(true, elements.Skip(1).First().IsChecked); } - [Test] + [TestOnSeparateThread] public void DoubleInputHasTextBoxAndCorrectValue() { Open(@"UI\CoreUINodes.dyn"); @@ -92,7 +92,7 @@ public void DoubleInputHasTextBoxAndCorrectValue() Assert.AreEqual("12.000", element.Text); } - [Test] + [TestOnSeparateThread] public void DoubleSliderHasSliderAndCorrectValues() { Open(@"UI\CoreUINodes.dyn"); @@ -103,7 +103,7 @@ public void DoubleSliderHasSliderAndCorrectValues() Assert.AreEqual(1.0, element.slider.Value, 1e-6); } - [Test] + [TestOnSeparateThread] public void doubleInputNodeWillNotAcceptRangeSyntax() { var number = new DoubleInput(); @@ -118,7 +118,7 @@ public void doubleInputNodeWillNotAcceptRangeSyntax() } - [Test] + [TestOnSeparateThread] public void doubleInputNodeWillNotAcceptIds() { var number = new DoubleInput(); @@ -135,7 +135,7 @@ public void doubleInputNodeWillNotAcceptIds() //these tests live here as they have a dependency on CoreNodesWpf which //is only accessible at test time after it is loaded via Dynamo - [Test] + [TestOnSeparateThread] [Category("UnitTests")] public static void validateNumericFailsOnNonNumericInputs() { @@ -152,7 +152,7 @@ public static void validateNumericFailsOnNonNumericInputs() Assert.IsFalse(numericalRule.Validate("a", CultureInfo.InvariantCulture).IsValid); } - [Test] + [TestOnSeparateThread] [Category("UnitTests")] public static void validateNumericPassesOnNumericInputs() { @@ -168,7 +168,7 @@ public static void validateNumericPassesOnNumericInputs() } - [Test] + [TestOnSeparateThread] public void IntegerSliderHasSliderAndCorrectValues() { Open(@"UI\CoreUINodes.dyn"); @@ -179,7 +179,7 @@ public void IntegerSliderHasSliderAndCorrectValues() Assert.AreEqual(41, element.slider.Value, 1e-6); } - [Test] + [TestOnSeparateThread] public void FilenameHasButton() { Open(@"UI\CoreUINodes.dyn"); @@ -190,7 +190,7 @@ public void FilenameHasButton() Assert.AreEqual(1, eles.Count()); } - [Test] + [TestOnSeparateThread] public void DirectoryHasButton() { Open(@"UI\CoreUINodes.dyn"); @@ -202,7 +202,7 @@ public void DirectoryHasButton() Assert.AreEqual(1, eles.Count()); } - [Test] + [TestOnSeparateThread] public void LengthFromStringHasTextBoxWithCorrectValue() { Open(@"UI\CoreUINodes.dyn"); @@ -218,7 +218,7 @@ public void LengthFromStringHasTextBoxWithCorrectValue() } - [Test] + [TestOnSeparateThread] public void VolumeFromStringHasTextBoxWithCorrectValue() { Open(@"UI\CoreUINodes.dyn"); @@ -229,7 +229,7 @@ public void VolumeFromStringHasTextBoxWithCorrectValue() Assert.AreEqual("0.000m³", ele.Text); } - [Test] + [TestOnSeparateThread] public void AreaFromStringHasTextBoxWithCorrectValue() { Open(@"UI\CoreUINodes.dyn"); @@ -240,7 +240,7 @@ public void AreaFromStringHasTextBoxWithCorrectValue() Assert.AreEqual("0.000m²", ele.Text); } - [Test] + [TestOnSeparateThread] public void PythonNodeHasButtonsAndCorrectNumberOfInputs() { Open(@"UI\CoreUINodes.dyn"); @@ -254,7 +254,7 @@ public void PythonNodeHasButtonsAndCorrectNumberOfInputs() Assert.AreEqual(6, inputPortControl.ChildrenOfType().Count()); } - [Test] + [TestOnSeparateThread] public void PythonStringNodeHasButtonsAndCorrectNumberOfInputs() { Open(@"UI\CoreUINodes.dyn"); @@ -268,7 +268,7 @@ public void PythonStringNodeHasButtonsAndCorrectNumberOfInputs() Assert.AreEqual(8, inputPortControl.ChildrenOfType().Count()); } - [Test] + [TestOnSeparateThread] public void WatchIsEmptyWhenLoaded() { Open(@"UI\WatchUINodes.dyn"); @@ -318,7 +318,7 @@ public void WatchImageCoreContainsImage() Assert.Greater(img.ActualHeight, 10); } - [Test] + [TestOnSeparateThread] public void CustomNodeIsCustomized() { Open(@"UI\CoreUINodes.dyn"); @@ -329,7 +329,7 @@ public void CustomNodeIsCustomized() Assert.True(nodeView.customNodeBorder0.Visibility == Visibility.Visible); } - [Test] + [TestOnSeparateThread] public void DSVarArgFunctionNodeHasButtons() { Open(@"UI\VariableInputNodes.dyn"); @@ -359,7 +359,7 @@ public void DSVarArgFunctionNodeHasButtons() Assert.AreEqual(4, inputPortControl.ChildrenOfType().Count()); } - [Test] + [TestOnSeparateThread] public void TestColorRangeNodeOnMultipleFilesWithoutClosing() { Open(@"UI\UIColorRange.dyn"); @@ -378,7 +378,7 @@ public void TestColorRangeNodeOnMultipleFilesWithoutClosing() Assert.IsNotNull(image.Source); } - [Test] + [TestOnSeparateThread] public void InvalidInputShouldNotCrashColorRangeNode() { Open(@"UI\ColorRangeInvalidInputCrash.dyn"); @@ -392,7 +392,7 @@ public void InvalidInputShouldNotCrashColorRangeNode() Model.CurrentWorkspace.Guid, guid, "Code", "5.6")); } - [Test] + [TestOnSeparateThread] public void ArrayExprShouldNotCrashColorRangeNode() { var guid = System.Guid.Parse("c90f5c20-8c63-4708-bd1a-289647bae471"); @@ -405,7 +405,7 @@ public void ArrayExprShouldNotCrashColorRangeNode() Assert.Pass(); // We should reach here safely without exception. } - [Test] + [TestOnSeparateThread] public void InvalidValueShouldNotCrashColorRangeNode() { var guid0 = Guid.Parse("1a245b04-ad9e-4b9c-8301-730afbd4e6fc"); @@ -468,7 +468,7 @@ public void WatchConnectDisconnectTest() Assert.AreEqual(8, items.Count()); } - [Test] + [TestOnSeparateThread] public void TestEditReadOnlyCustomNodeProperty() { // Open a read-only custom node @@ -493,7 +493,7 @@ public void TestEditReadOnlyCustomNodeProperty() } } - [Test] + [TestOnSeparateThread] public void INodeViewCustomizationCheckUsingReflectionIsCorrect() { var dyncorewpfAssem = AppDomain.CurrentDomain.GetAssemblies().Where(x => x.GetName().Name == "DynamoCoreWpf").FirstOrDefault(); diff --git a/test/DynamoCoreWpfTests/NodeViewTests.cs b/test/DynamoCoreWpfTests/NodeViewTests.cs index 0c956ba0233..509d00e469d 100644 --- a/test/DynamoCoreWpfTests/NodeViewTests.cs +++ b/test/DynamoCoreWpfTests/NodeViewTests.cs @@ -45,7 +45,7 @@ public override void Run() DispatcherUtil.DoEvents(); } - [Test] + [TestOnSeparateThread] public void ZIndex_Test_MouseDown() { // Reset zindex to start value. @@ -67,7 +67,7 @@ public void ZIndex_Test_MouseDown() Assert.AreEqual(nodeView.ViewModel.ZIndex, Dynamo.ViewModels.NodeViewModel.StaticZIndex); } - [Test] + [TestOnSeparateThread] public void ZIndex_Test_MouseEnter_Leave() { // Reset zindex to start value. @@ -108,7 +108,7 @@ public void ZIndex_Test_MouseEnter_Leave() }; } - [Test] + [TestOnSeparateThread] public void ZIndex_NodeAsMemberOfGroup() { // Reset zindex to start value. @@ -158,7 +158,7 @@ public void ZIndex_NodeAsMemberOfGroup() }; } - [Test] + [TestOnSeparateThread] public void NodesHaveCorrectLocationsIndpendentOfCulture() { string openPath = @"core\nodeLocationTest.dyn"; @@ -189,7 +189,7 @@ public void NodesHaveCorrectLocationsIndpendentOfCulture() Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-US"); } - [Test] + [TestOnSeparateThread] public void SettingNodeAsInputOrOutputMarksGraphAsModified() { Open(@"core\isInput_isOutput\IsInput.dyn"); @@ -244,7 +244,7 @@ public void SettingNodeAsInputOrOutputMarksGraphAsModified() File.Delete(tempPath); } - [Test] + [TestOnSeparateThread] public void SettingOriginalNodeName() { Open(@"core\originalNodeNameTests\originalNodeName.dyn"); @@ -267,7 +267,7 @@ public void SettingOriginalNodeName() Assert.AreEqual(nodeViewModel.OriginalName, expectedOriginalName); } - [Test] + [TestOnSeparateThread] public void CheckDummyNodeName() { Open(@"core\originalNodeNameTests\originalNodeName.dyn"); @@ -282,7 +282,7 @@ public void CheckDummyNodeName() Assert.AreEqual(nodeViewModel.OriginalName, expectedOriginalName); } - [Test] + [TestOnSeparateThread] public void CheckNotLoadedCustomNodeOriginalName() { // Custom node inside is not loaded this case so that renamed tag will be disabled @@ -299,7 +299,7 @@ public void CheckNotLoadedCustomNodeOriginalName() Assert.AreEqual(nodeViewModel.OriginalName, expectedOriginalName); } - [Test] + [TestOnSeparateThread] public void CheckLoadedCustomNodeOriginalName() { // Opening the dyf first will make sure the custom node is loaded @@ -318,7 +318,7 @@ public void CheckLoadedCustomNodeOriginalName() Assert.AreEqual(nodeViewModel.OriginalName, expectedNewOriginalName); } - [Test] + [TestOnSeparateThread] public void SettingOriginalNodeNameOnCustomNode() { Open(@"core\originalNodeNameTests\originalNodeNameCustomNode.dyn"); @@ -341,7 +341,7 @@ public void SettingOriginalNodeNameOnCustomNode() Assert.AreEqual(nodeViewModel.OriginalName, expectedOriginalName); } - [Test] + [TestOnSeparateThread] public void InputPortType_NodeModelNode_AreCorrect() { Open(@"UI\CoreUINodes.dyn"); @@ -357,7 +357,7 @@ public void InputPortType_NodeModelNode_AreCorrect() Assert.AreEqual("System.Drawing.Bitmap", type); } - [Test] + [TestOnSeparateThread] [Category("RegressionTests")] public void GettingNodeNameDoesNotTriggerPropertyChangeCycle() { @@ -383,7 +383,7 @@ private void NodeNameTest_PropChangedHandler(object sender, System.ComponentMode /// Check if elements are correctly displayed/collapsed on zoom level change /// Current zoom level is 0.4 (hard-coded in multiple Converters /// - [Test] + [TestOnSeparateThread] public void ZoomChangeVisibilityTest() { // Arrange @@ -406,7 +406,7 @@ public void ZoomChangeVisibilityTest() Assert.AreEqual(nodeViewWarningWarningFrozenHidden.nodeColorOverlayZoomOut.Visibility, System.Windows.Visibility.Collapsed); } - [Test] + [TestOnSeparateThread] public void ZoomWarningFileFromPathTest() { // Arrange @@ -442,7 +442,7 @@ public void ZoomWarningFileFromPathTest() /// Tests the GetWarningColor method to ensure that the node's WarningBar displays /// the proper colors when a node is displaying Info/Warning/Error messages. /// - [Test] + [TestOnSeparateThread] public void WarningColorReflectsElementState() { // Arrange @@ -477,7 +477,7 @@ public void WarningColorReflectsElementState() /// Assert node color border to check if colors correspond /// to the correct node state for PreviewOff/Frozen/Info/Warning/Error states /// - [Test] + [TestOnSeparateThread] public void ZoomNodeColorReflectElementState() { // Arrange @@ -535,7 +535,7 @@ public void ZoomNodeColorReflectElementState() /// Assert node color border to check if colors correspond /// to the correct node state for PreviewOff/Frozen/Info/Warning/Error states /// - [Test] + [TestOnSeparateThread] public void ZoomNodeGlyphStatesCheck() { // Arrange @@ -571,7 +571,7 @@ public void ZoomNodeGlyphStatesCheck() Assert.AreEqual(nodeViewModelWarningWarningFrozenHidden.ImgGlyphThreeSource.Split('/').Last(), "alert-64px.png"); } - [Test] + [TestOnSeparateThread] public void TestPortColors_NodeModel() { Open(@"UI\color_range_ports.dyn"); @@ -622,7 +622,7 @@ public void TestPortColors_NodeModel() Assert.True((doutPorts[0] as OutPortViewModel).PortDefaultValueMarkerVisible); } - [Test] + [TestOnSeparateThread] public void TestPortDefaultValueMarket_Visibility() { Open(@"UI\outport_valuemarker_portDefaultValueMarkerVisible.dyn"); @@ -640,7 +640,7 @@ public void TestPortDefaultValueMarket_Visibility() Assert.AreEqual(outPort_Without_Function.ValueMarkerWidth, outPort_Without_Function.ValueMarkerWidthWithoutFunction); } - [Test] + [TestOnSeparateThread] public void TestSelectNeighborPins() { // Open and run the workspace diff --git a/test/DynamoCoreWpfTests/NoteViewTests.cs b/test/DynamoCoreWpfTests/NoteViewTests.cs index 71258386908..555f4f9761f 100644 --- a/test/DynamoCoreWpfTests/NoteViewTests.cs +++ b/test/DynamoCoreWpfTests/NoteViewTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Threading; using System.Windows.Input; @@ -26,7 +26,7 @@ public override void Run() DispatcherUtil.DoEvents(); } - [Test] + [TestOnSeparateThread] public void T01_ZIndex_Test_MouseDown() { // Reset zindex to start value. @@ -47,7 +47,7 @@ public void T01_ZIndex_Test_MouseDown() Assert.AreEqual(noteView.ViewModel.ZIndex, Dynamo.ViewModels.NoteViewModel.StaticZIndex); } - [Test] + [TestOnSeparateThread] public void T02_ZIndex_Test_NoteGreaterThanNode() { //Reset ZIndex to start value for both NoteViewModel and NodeViewModel @@ -70,7 +70,7 @@ public void T02_ZIndex_Test_NoteGreaterThanNode() Assert.Greater(Dynamo.ViewModels.NoteViewModel.StaticZIndex, Dynamo.ViewModels.NodeViewModel.StaticZIndex); } - [Test] + [TestOnSeparateThread] public void T03_Mousedown_NoteGreaterThanNode() { //Reset ZIndex to start value for both NoteViewModel and NodeViewModel @@ -95,7 +95,7 @@ public void T03_Mousedown_NoteGreaterThanNode() /// /// Check if you can pin node to note /// - [Test] + [TestOnSeparateThread] public void CanPinNodeToNode() { // Open document and get node and note view @@ -120,7 +120,7 @@ public void CanPinNodeToNode() /// check that if the note is selected /// the pinned node is selected as well /// - [Test] + [TestOnSeparateThread] public void CanSelectPinnedNodeThroughNote() { // Open document and get node and note view @@ -156,7 +156,7 @@ public void CanSelectPinnedNodeThroughNote() /// check that the note is positioned /// 12 pixels above node /// - [Test] + [TestOnSeparateThread] public void NoteIsPlacedAbovePinnedNode() { // Open document and get node and note view @@ -184,7 +184,7 @@ public void NoteIsPlacedAbovePinnedNode() /// check that the note is positioned /// 32 pixels above node /// - [Test] + [TestOnSeparateThread] public void NoteIsPlacedAbovePinnedNodeInErrorState() { // Open document and get node and note view @@ -215,7 +215,7 @@ public void NoteIsPlacedAbovePinnedNodeInErrorState() /// Makes sure that only when one node and note /// are selected the PinToNode command is enabled /// - [Test] + [TestOnSeparateThread] public void PinToNodeCommandIsProperlyEnabled() { // Open document and get nodes and note views @@ -253,7 +253,7 @@ public void PinToNodeCommandIsProperlyEnabled() /// Check that workspace model is aware that changes were made /// when a node is pinned to a note. /// - [Test] + [TestOnSeparateThread] public void HasUnsavedChangesWhenPinToNode() { // Open document and get node and note view @@ -276,7 +276,7 @@ public void HasUnsavedChangesWhenPinToNode() Assert.IsTrue(nodeAView.ViewModel.WorkspaceViewModel.HasUnsavedChanges); } - [Test] + [TestOnSeparateThread] public void UndoPinNode() { // Open document and get node and note view diff --git a/test/DynamoCoreWpfTests/PackageManager/PackageManagerExtensionLoadingTests.cs b/test/DynamoCoreWpfTests/PackageManager/PackageManagerExtensionLoadingTests.cs index b1a383aa247..9bee87f91b4 100644 --- a/test/DynamoCoreWpfTests/PackageManager/PackageManagerExtensionLoadingTests.cs +++ b/test/DynamoCoreWpfTests/PackageManager/PackageManagerExtensionLoadingTests.cs @@ -36,14 +36,14 @@ protected override DynamoModel.IStartConfiguration CreateStartConfiguration(IPat }; } - [Test] + [TestOnSeparateThread] public void PackageManagerLoadsAndAddsExtension() { Assert.That(Model.ExtensionManager.Extensions.Select(x => x.Name), Is.EquivalentTo(new List { "DynamoPackageManager", "DynamoMLDataPipelineExtension", "testExtension" })); } - [Test] + [TestOnSeparateThread] public void PackageManagerLoadsExtensionAndItWorks() { @@ -53,7 +53,7 @@ public void PackageManagerLoadsExtensionAndItWorks() //assert the extension was keeping track of the node events in the workspace. Assert.AreEqual(1, (sampleExtension.nodes as List).Count()); } - [Test] + [TestOnSeparateThread] public void PackageManagerLoadsAndAddsViewExtension() { Assert.That(View.viewExtensionManager.ViewExtensions.OrderBy(x => x.Name).Select(x => x.Name), @@ -77,7 +77,7 @@ public void PackageManagerLoadsAndAddsViewExtension() ); } - [Test] + [TestOnSeparateThread] public void PackageManagerLoadsViewExtensionAndItWorks() { dynamic sampleExtension = View.viewExtensionManager.ViewExtensions.Where(x => x.Name == "Sample View Extension").FirstOrDefault(); diff --git a/test/DynamoCoreWpfTests/PackageManager/PackageManagerViewExtensionTests.cs b/test/DynamoCoreWpfTests/PackageManager/PackageManagerViewExtensionTests.cs index 066fa5a7e08..2c2d34fd0d2 100644 --- a/test/DynamoCoreWpfTests/PackageManager/PackageManagerViewExtensionTests.cs +++ b/test/DynamoCoreWpfTests/PackageManager/PackageManagerViewExtensionTests.cs @@ -149,20 +149,20 @@ private static PortableExecutableReference[] GetGlobalReferences() return returnList.ToArray(); } - [Test] + [TestOnSeparateThread] public void PackageManagerLoadsRuntimeGeneratedExtension() { Assert.IsTrue(View.viewExtensionManager.ViewExtensions.Select(x => x.Name).Contains("Test View Extension")); } - [Test] + [TestOnSeparateThread] public void PackageManagerViewExtensionHasCorrectNumberOfRequestedExtensions() { var pkgViewExtension = View.viewExtensionManager.ViewExtensions.OfType().FirstOrDefault(); Assert.AreEqual(pkgViewExtension.RequestedExtensions.Count(), 1); } - [Test] + [TestOnSeparateThread] public void LateLoadedViewExtensionsHaveMethodsCalled() { var pkgviewExtension = View.viewExtensionManager.ViewExtensions.OfType().FirstOrDefault(); @@ -221,7 +221,7 @@ public void LateLoadedViewExtensionsHaveMethodsCalled() } - [Test] + [TestOnSeparateThread] public void StartUpAndLoadedAreCalledOnceOnViewExtensionsInPackges() { //this extension is compiled at testTime and injected into test package folder. @@ -231,7 +231,7 @@ public void StartUpAndLoadedAreCalledOnceOnViewExtensionsInPackges() Assert.AreEqual(1, testExtension.loadedCount); } - [Test] + [TestOnSeparateThread] public void PackageManagerViewExtesion_TriesToLoadLayoutSpecForBuiltInPackages() { //check that the packageManagerViewExtension requested the test layout spec to be applied. @@ -254,7 +254,7 @@ public void PackageManagerViewExtesion_TriesToLoadLayoutSpecForBuiltInPackages() Assert.AreEqual(Path.Combine(BuiltinPackagesTestDir, "SignedPackage2", "extra", "layoutspecs.json"), packageManagerViewExtension.RequestedLayoutSpecPaths.FirstOrDefault()); } - [Test] + [TestOnSeparateThread] public void PackageManagerViewExtesion_SendsNotificationForPackagesThatTargetDifferentHost_AtExtensionLoad() { var count = 0; @@ -287,7 +287,7 @@ void PackageManagerViewExtensionTests_NotificationLogged(NotificationMessage obj } } - [Test] + [TestOnSeparateThread] public void PackageManagerViewExtesion_SendsNotificationForPackagesThatTargetDifferentHost_AtLatePackageLoad() { var count = 0; @@ -316,7 +316,7 @@ void PackageManagerViewExtensionTests_NotificationLogged(NotificationMessage obj } } - [Test] + [TestOnSeparateThread] public void TestCrashInPackage() { var pkgDir = Path.Combine(PackagesDirectory, "SampleViewExtension_Crash"); diff --git a/test/DynamoCoreWpfTests/PackagePathTests.cs b/test/DynamoCoreWpfTests/PackagePathTests.cs index 59e6e30ddc2..8f72c86976f 100644 --- a/test/DynamoCoreWpfTests/PackagePathTests.cs +++ b/test/DynamoCoreWpfTests/PackagePathTests.cs @@ -56,7 +56,7 @@ internal static string TestDirectory internal string BuiltInPackagesTestDir { get { return Path.Combine(TestDirectory, "builtinpackages testdir", "Packages"); } } #region PackagePathViewModelTests - [Test] + [TestOnSeparateThread] public void CannotDeletePathIfThereIsOnlyOne() { var setting = new PreferenceSettings @@ -71,7 +71,7 @@ public void CannotDeletePathIfThereIsOnlyOne() Assert.IsFalse(vm.DeletePathCommand.CanExecute(null)); } - [Test] + [TestOnSeparateThread] public void ReorderingPathsTest() { var setting = new PreferenceSettings @@ -103,7 +103,7 @@ public void ReorderingPathsTest() Assert.AreEqual(@"C:\", vm.RootLocations[2]); } - [Test] + [TestOnSeparateThread] public void CannotDeleteBuiltinPackagesPath() { var setting = new PreferenceSettings @@ -119,7 +119,7 @@ public void CannotDeleteBuiltinPackagesPath() Assert.IsTrue(vm.DeletePathCommand.CanExecute(1)); } - [Test] + [TestOnSeparateThread] public void CannotUpdateBuiltinPackagesPath() { var setting = new PreferenceSettings @@ -134,7 +134,7 @@ public void CannotUpdateBuiltinPackagesPath() Assert.IsFalse(vm.UpdatePathCommand.CanExecute(0)); Assert.IsTrue(vm.UpdatePathCommand.CanExecute(1)); } - [Test] + [TestOnSeparateThread] public void CannotDeleteProgramDataPath() { var setting = new PreferenceSettings @@ -150,7 +150,7 @@ public void CannotDeleteProgramDataPath() Assert.IsTrue(vm.DeletePathCommand.CanExecute(1)); } - [Test] + [TestOnSeparateThread] public void CannotUpdateProgramDataPath() { var setting = new PreferenceSettings @@ -166,7 +166,7 @@ public void CannotUpdateProgramDataPath() Assert.IsTrue(vm.UpdatePathCommand.CanExecute(1)); } - [Test] + [TestOnSeparateThread] public void AddRemovePathsTest() { var setting = new PreferenceSettings() @@ -192,7 +192,7 @@ public void AddRemovePathsTest() Assert.AreEqual(@"C:\", vm.RootLocations[0]); Assert.AreEqual(@"D:\", vm.RootLocations[1]); } - [Test] + [TestOnSeparateThread] public void AddPackagePathsTest() { var setting = new PreferenceSettings() @@ -214,7 +214,7 @@ public void AddPackagePathsTest() Assert.AreEqual(1,GetPreviewValue("07d62dd8-b2f3-40a8-a761-013d93300444")); } - [Test] + [TestOnSeparateThread] public void InstalledPackagesContainsCorrectNumberOfPackages() { var setting = new PreferenceSettings() @@ -250,7 +250,7 @@ public void InstalledPackagesContainsCorrectNumberOfPackages() vm.packageLoader.RequestLoadNodeLibrary -= libraryLoader.LoadLibraryAndSuppressZTSearchImport; } - [Test] + [TestOnSeparateThread] public void RemoveAddPackagePathChangesInstalledPackageState() { var setting = new PreferenceSettings() @@ -294,7 +294,7 @@ public void RemoveAddPackagePathChangesInstalledPackageState() vm.packageLoader.RequestLoadNodeLibrary -= libraryLoader.LoadLibraryAndSuppressZTSearchImport; } - [Test] + [TestOnSeparateThread] public void EnableCustomPackagePathsLoadsPackagesOnClosingPreferences() { var setting = new PreferenceSettings() @@ -329,7 +329,7 @@ public void EnableCustomPackagePathsLoadsPackagesOnClosingPreferences() vm.packageLoader.RequestLoadNodeLibrary -= libraryLoader.LoadLibraryAndSuppressZTSearchImport; } - [Test] + [TestOnSeparateThread] public void PathEnabledConverterCustomPaths() { var setting = new PreferenceSettings() @@ -351,7 +351,7 @@ public void PathEnabledConverterCustomPaths() Assert.True((bool)x.Convert(new object[] { vm, path }, null, null, null)); } - [Test] + [TestOnSeparateThread] public void PathEnabledConverterBltinpackagesPath() { var setting = new PreferenceSettings() @@ -374,7 +374,7 @@ public void PathEnabledConverterBltinpackagesPath() Assert.False((bool)x.Convert(new object[] { vm, @"Z:\" }, null, null, null)); } - [Test] + [TestOnSeparateThread] public void IfPathsAreUnchangedPackagesAreNotReloaded() { var count = 0; @@ -419,7 +419,7 @@ void Loader_PackagesLoaded(System.Collections.Generic.IEnumerable obj) vm.packageLoader.PackagesLoaded -= Loader_PackagesLoaded; } - [Test] + [TestOnSeparateThread] public void PathsAddedToCustomPacakgePathPreferences_SurvivePreferenceDialogOpenClose() { //add a new path to the package paths @@ -482,7 +482,7 @@ protected override DynamoModel.IStartConfiguration CreateStartConfiguration(IPat }; } - [Test] + [TestOnSeparateThread] public void IfProgramDataPathIsFirstDefaultPackagePathIsStillAppData() { var setting = Model.PreferenceSettings; diff --git a/test/DynamoCoreWpfTests/PreferencesGeometryScalingTests.cs b/test/DynamoCoreWpfTests/PreferencesGeometryScalingTests.cs index 30832bf60ef..e7e549633a2 100644 --- a/test/DynamoCoreWpfTests/PreferencesGeometryScalingTests.cs +++ b/test/DynamoCoreWpfTests/PreferencesGeometryScalingTests.cs @@ -32,7 +32,7 @@ protected override void GetLibrariesToPreload(List libraries) /// /// The test validates that when RunType=Automatic and the MarkNodesAsModifiedAndRequestRun() method is called the graph execution is kicked off /// - [Test] + [TestOnSeparateThread] public void PreferencesGeoScaling_RunGraph_Automatic() { var dynamoViewModel = (View.DataContext as DynamoViewModel); @@ -74,7 +74,7 @@ public void PreferencesGeoScaling_RunGraph_Automatic() /// /// The test validates that when RunType=Manual and the MarkNodesAsModifiedAndRequestRun() method is called the graph execution is NOT kicked off /// - [Test] + [TestOnSeparateThread] public void PreferencesGeoScaling_RunGraph_Manual_Mode() { //The GeometryScalingCodeBlock.dyn contains a CodeBlock with a large number that needs ScaleFactor > Medium diff --git a/test/DynamoCoreWpfTests/PreviewBubbleTests.cs b/test/DynamoCoreWpfTests/PreviewBubbleTests.cs index c5372574009..2b0b19ec401 100644 --- a/test/DynamoCoreWpfTests/PreviewBubbleTests.cs +++ b/test/DynamoCoreWpfTests/PreviewBubbleTests.cs @@ -40,7 +40,7 @@ protected override void GetLibrariesToPreload(List libraries) base.GetLibrariesToPreload(libraries); } - [Test] + [TestOnSeparateThread] public void PreviewBubbleVisible_MouseMoveOverNode() { Open(@"core\DetailedPreviewMargin_Test.dyn"); @@ -52,7 +52,7 @@ public void PreviewBubbleVisible_MouseMoveOverNode() Assert.IsTrue(nodeView.PreviewControl.IsCondensed); } - [Test] + [TestOnSeparateThread] public void PreviewBubbleVisible_MouseMoveOverNode_InCustomWorkspace() { Open(@"core\custom_node_saving\Constant2.dyf"); @@ -64,7 +64,7 @@ public void PreviewBubbleVisible_MouseMoveOverNode_InCustomWorkspace() Assert.IsTrue(nodeView.PreviewControl.IsHidden); } - [Test] + [TestOnSeparateThread] public void PreviewBubbleVisible_MouseMoveOutOfNode() { Open(@"core\DetailedPreviewMargin_Test.dyn"); @@ -93,7 +93,7 @@ public void PreviewBubbleHidden_OnFrozenNode() Assert.IsTrue(nodeView.PreviewControl.IsHidden); } - [Test] + [TestOnSeparateThread] public void PreviewBubble_ListMargin() { OpenAndRun(@"core\DetailedPreviewMargin_Test.dyn"); @@ -112,7 +112,7 @@ public void PreviewBubble_ListMargin() Assert.AreEqual(new System.Windows.Thickness(5, 0, 5, 5), watchTree.ChildOfType().Margin); } - [Test] + [TestOnSeparateThread] public void PreviewBubble_NumberMargin() { OpenAndRun(@"core\DetailedPreviewMargin_Test.dyn"); @@ -131,7 +131,7 @@ public void PreviewBubble_NumberMargin() Assert.AreEqual(new System.Windows.Thickness(-5, 0, 0, 0), watchTree.ChildOfType().Margin); } - [Test] + [TestOnSeparateThread] public void PreviewBubble_CloseWhenFocusInCodeBlock() { OpenAndRun(@"core\DetailedPreviewMargin_Test.dyn"); @@ -148,7 +148,7 @@ public void PreviewBubble_CloseWhenFocusInCodeBlock() Assert.IsTrue(nodeView.PreviewControl.IsHidden); } - [Test] + [TestOnSeparateThread] public void PreviewBubble_NoCrashWithCodeBlock() { var code = new CodeBlockNodeModel(this.Model.LibraryServices); @@ -170,7 +170,7 @@ public void PreviewBubble_NoCrashWithCodeBlock() Assert.IsTrue(nodeView.PreviewControl.IsHidden); } - [Test] + [TestOnSeparateThread] public void PreviewBubble_CodeBlockIsNotInFocus() { var code = new CodeBlockNodeModel(this.Model.LibraryServices); @@ -212,7 +212,7 @@ public void PreviewBubble_CodeBlockIsNotInFocus() Assert.IsTrue(nodeView.PreviewControl.IsExpanded); } - [Test] + [TestOnSeparateThread] public void PreviewBubble_IsExpandedChangedInWatchTree() { OpenAndRun(@"core\DetailedPreviewMargin_Test.dyn"); @@ -255,7 +255,7 @@ public void PreviewBubble_IsExpandedChangedInWatchTree() #region Watch PreviewBubble - [Test] + [TestOnSeparateThread] public void Watch_PreviewAllowanceDisabled() { OpenAndRun(@"core\WatchPreviewBubble.dyn"); @@ -267,7 +267,7 @@ public void Watch_PreviewAllowanceDisabled() Assert.IsTrue(nodeView.PreviewControl.IsHidden); } - [Test] + [TestOnSeparateThread] public void Watch_DefaultSize() { OpenAndRun(@"core\WatchTree.dyn"); @@ -289,7 +289,7 @@ public void Watch_DefaultSize() Assert.AreEqual(rawEmptyWatchNode.Width, WatchTree.DefaultWidthSize); } - [Test] + [TestOnSeparateThread] public void Watch_SingleValueSize() { OpenAndRun(@"core\WatchTree.dyn"); @@ -315,7 +315,7 @@ public void Watch_SingleValueSize() Assert.AreEqual(rawSingleValueWatchNode.Width, (watchNodeValue.Length * rawSingleValueWatchNode.WidthPerCharacter) + rawSingleValueWatchNode.ExtratWidthSize); } - [Test] + [TestOnSeparateThread] public void Watch_ListSize() { OpenAndRun(@"core\WatchTree.dyn"); @@ -353,7 +353,7 @@ public void Watch_ListSize() Assert.AreEqual(rawListWatchNode.Height, WatchTree.DefaultHeightSize); } - [Test] + [TestOnSeparateThread] public void Watch_MaxWidthSize() { OpenAndRun(@"core\WatchTree.dyn"); @@ -385,7 +385,7 @@ public void Watch_MaxWidthSize() Assert.AreEqual(rawLongLinetWatchNode.MaxWidthSize + rawLongLinetWatchNode.ExtratWidthSize, rawLongLinetWatchNode.Width); } - [Test] + [TestOnSeparateThread] public void Watch_ColorRange() { OpenAndRun(@"core\WatchTree.dyn"); @@ -411,7 +411,7 @@ public void Watch_ColorRange() Assert.AreEqual(34, colorRangeWatchNodeModel.OutPorts[0].Height); } - [Test] + [TestOnSeparateThread] public void Watch_MultilineString() { OpenAndRun(@"core\WatchTree.dyn"); @@ -439,7 +439,7 @@ public void Watch_MultilineString() Assert.AreEqual(WatchTree.DefaultHeightSize, rawMultiLineStringtWatchNode.Height); } - [Test] + [TestOnSeparateThread] public void Watch_Dictionary() { OpenAndRun(@"core\WatchTree.dyn"); @@ -467,7 +467,7 @@ public void Watch_Dictionary() #endregion - [Test] + [TestOnSeparateThread] public void PreviewBubble_HiddenDummyVerticalBoundaries() { Open(@"core\DetailedPreviewMargin_Test.dyn"); @@ -501,7 +501,7 @@ public void PreviewBubble_HiddenDummyVerticalBoundaries() Assert.IsTrue(ElementIsInContainerWithEpsilonCompare(nodeView.PreviewControl.HiddenDummy, nodeView, 10)); } - [Test] + [TestOnSeparateThread] public void PreviewBubble_ToggleShowPreviewBubbles() { Open(@"core\DetailedPreviewMargin_Test.dyn"); @@ -567,7 +567,7 @@ public void PreviewBubble_UnpinAllPreviewBubble() } } - [Test] + [TestOnSeparateThread] public void PreviewBubble_ShowExpandedPreviewOnPinIconHover() { Open(@"core\DetailedPreviewMargin_Test.dyn"); @@ -591,7 +591,7 @@ public void PreviewBubble_ShowExpandedPreviewOnPinIconHover() Assert.IsTrue(previewBubble.IsExpanded, "Expanded preview bubble should be shown"); } - [Test] + [TestOnSeparateThread] public void PreviewBubble_ShowExpandedPreview_MultiReturnNode() { Open(@"core\multireturnnode_preview.dyn"); @@ -615,7 +615,7 @@ public void PreviewBubble_ShowExpandedPreview_MultiReturnNode() Assert.IsTrue(previewBubble.IsExpanded, "Expanded preview bubble should be shown"); } - [Test] + [TestOnSeparateThread] public void PreviewBubble_ShownForColorRange() { var colorRange = new ColorRange(); @@ -629,7 +629,7 @@ public void PreviewBubble_ShownForColorRange() Assert.IsFalse(nodeView.PreviewControl.IsHidden, "Preview bubble for color range should be shown"); } - [Test] + [TestOnSeparateThread] public void InfoBubble_AvoidDuplicatedWarningMessages() { Open(@"core\watch\WatchDuplicatedWarningMessages.dyn"); @@ -650,7 +650,7 @@ public void InfoBubble_AvoidDuplicatedWarningMessages() Assert.AreEqual(1, nodeView.ViewModel.ErrorBubble.NodeMessages.Count); } - [Test] + [TestOnSeparateThread] public void InfoBubble_ShowsWarningOnCopyPastedCBN() { Open(@"core\watch\ShowsWarningOnCopyPastedCBN.dyn"); @@ -677,7 +677,7 @@ public void InfoBubble_ShowsWarningOnCopyPastedCBN() } } - [Test] + [TestOnSeparateThread] public void InfoBubble_ShowsWarningOnNode2Code() { Open(@"core\watch\infobubble_warning_on_n2c.dyn"); @@ -697,7 +697,7 @@ public void InfoBubble_ShowsWarningOnNode2Code() Assert.IsTrue(msgs[0].Message.Contains("You cannot define a variable more than once.")); } - [Test] + [TestOnSeparateThread] public void InfoBubble_ShowsWarningOnDupVariableInCodeBlock() { Open(@"core\watch\cbn_dup_variable_open_file.dyn"); @@ -708,7 +708,7 @@ public void InfoBubble_ShowsWarningOnDupVariableInCodeBlock() Assert.IsTrue(nodeView.ViewModel.ErrorBubble.NodeMessages[0].Message.Contains("You cannot define a variable more than once.")); } - [Test] + [TestOnSeparateThread] public void InfoBubble_ShowsWarningOnObsoleteZeroTouchNode() { Open(@"core\watch\obsolete_zero_touch_node.dyn"); @@ -719,7 +719,7 @@ public void InfoBubble_ShowsWarningOnObsoleteZeroTouchNode() Assert.IsTrue(nodeView.ViewModel.ErrorBubble.NodeMessages[0].Message.Contains("Obsolete")); } - [Test] + [TestOnSeparateThread] public void InfoBubble_ShowsWarningErrorCBN() { Open(@"core\watch\ShowsWarningOnCopyPastedCBN.dyn"); @@ -746,7 +746,7 @@ public void InfoBubble_ShowsWarningErrorCBN() Assert.AreEqual(1, errors.Count()); } - [Test] + [TestOnSeparateThread] public void InfoBubble_ShowsWarningError_CopyPastedCBN() { Open(@"core\watch\ShowsWarningOnCopyPastedCBN.dyn"); @@ -794,7 +794,7 @@ public void InfoBubble_ShowsWarningError_CopyPastedCBN() Assert.AreEqual(1, errors.Count()); } - [Test] + [TestOnSeparateThread] public void InfoBubble_ShowsError_CopyPastedCBN_UndoRedo() { Open(@"core\watch\ShowsWarningOnCopyPastedCBN.dyn"); @@ -848,7 +848,7 @@ public void InfoBubble_ShowsError_CopyPastedCBN_UndoRedo() Assert.AreEqual(1, errors.Count()); } - [Test] + [TestOnSeparateThread] public void InfoBubble_ShowsWarningOnDummyNodes() { Open(@"core\watch\selectbycat.dyn"); @@ -865,7 +865,7 @@ public void InfoBubble_ShowsWarningOnDummyNodes() } } - [Test] + [TestOnSeparateThread] public void InfoBubble_ShowsWarningOnDeprecatedNode() { Open(@"core\watch\obsolete_if_node.dyn"); @@ -879,7 +879,7 @@ public void InfoBubble_ShowsWarningOnDeprecatedNode() Assert.AreEqual(Dynamo.ViewModels.InfoBubbleViewModel.Style.Warning, msgs[0].Style); } - [Test] + [TestOnSeparateThread] [Category("Failure")] public void PreviewBubble_CopyToClipboard() { diff --git a/test/DynamoCoreWpfTests/PythonNodeCustomizationTests.cs b/test/DynamoCoreWpfTests/PythonNodeCustomizationTests.cs index f084320fe4b..fe56d02351c 100644 --- a/test/DynamoCoreWpfTests/PythonNodeCustomizationTests.cs +++ b/test/DynamoCoreWpfTests/PythonNodeCustomizationTests.cs @@ -85,7 +85,7 @@ protected override void GetLibrariesToPreload(List libraries) /// This test checks if its possible to change the Python nodemodels Engine property /// from the dropdown selector inside the script editor. /// - [Test] + [TestOnSeparateThread] public void CanChangeEngineFromScriptEditorDropDown() { // Arrange @@ -145,7 +145,7 @@ public void CanChangeEngineFromScriptEditorDropDown() /// /// This test will validate the OnTextAreaTextEntering event that is generated by the ScriptEdirtorWindows when doing auto-completion /// - [Test] + [TestOnSeparateThread] public void OnTextAreaTextEnteringEventTest() { // Arrange @@ -216,7 +216,7 @@ private void TextArea_TextEntering(object sender, TextCompositionEventArgs e) /// OnRevertClicked(object sender, RoutedEventArgs e) /// OnRunClicked(object sender, RoutedEventArgs e) /// - [Test] + [TestOnSeparateThread] public void OnSaveRunRevertEventsTest() { Open(@"core\python\python_check_output.dyn"); @@ -266,7 +266,7 @@ public void OnSaveRunRevertEventsTest() /// /// This test method will validate that the OnMoreInfoEvent was executed correctly /// - [Test] + [TestOnSeparateThread] public void OnMoreInfoEventTest() { Open(@"core\python\python_check_output.dyn"); @@ -311,7 +311,7 @@ public void OnMoreInfoEventTest() /// PythonNode /// This test method will click in the "Learn more about Python" button and the OpenPythonLearningMaterial method from PythonNode.cs will be executed /// - [Test] + [TestOnSeparateThread] public void OpenPythonLearningMaterialValidationTest() { Open(@"core\python\python_check_output.dyn"); @@ -347,7 +347,7 @@ public void OpenPythonLearningMaterialValidationTest() /// PythonStringNode /// This test method will click in the "Learn more about Python" button and the OpenPythonLearningMaterial method from PythonStringNode.cs will be executed /// - [Test] + [TestOnSeparateThread] public void OpenPythonLearningMaterial_PythonNodeFromStringValidationTest() { Open(@"core\python\pyFromString_UnsavedEngine.dyn"); @@ -380,7 +380,7 @@ public void OpenPythonLearningMaterial_PythonNodeFromStringValidationTest() /// PythonStringNode /// This test method will click in the "Python Engine Version" menu option and the UpdateToPython3Engine() method from PythonStringNode.cs will be executed /// - [Test] + [TestOnSeparateThread] public void UpdateToPython3Engine_PythonStringNodeTest() { Open(@"core\python\pythonFromString2to3Test.dyn"); @@ -423,7 +423,7 @@ public void UpdateToPython3Engine_PythonStringNodeTest() /// /// This test method will execute the EditScriptContent method from the PythonNode.cs file (when there is already a Python Editor opened). /// - [Test] + [TestOnSeparateThread] public void EditScriptContent_ReActivateTest() { Open(@"core\python\python_check_output.dyn"); @@ -458,7 +458,7 @@ public void EditScriptContent_ReActivateTest() /// This test checks if its changing the engine via /// dropdown selector inside the script editor executes the most up to date code. /// - [Test] + [TestOnSeparateThread] public void ChangingDropdownEngineDoesNotSavesCodeOrRun() { // Arrange @@ -557,7 +557,7 @@ private static void SetEngineViaContextMenu(NodeView nodeView, string engine) /// This test checks if its possible to change the Python nodemodels Engine property /// from the context menu on the Python From String node. /// - [Test] + [TestOnSeparateThread] public void CanChangePythonEngineFromContextMenuOnPythonFromStringNode() { // Arrange @@ -609,7 +609,7 @@ public void CanChangePythonEngineFromContextMenuOnPythonFromStringNode() /// This test checks if the Python Node displays an EngineLabel showing which Engine the node is set to use, /// and if this label updates as expected when changing the Engine property on the nodemodel. /// - [Test] + [TestOnSeparateThread] public void PythonNodeHasLabelDisplayingCurrentEngine() { // Arrange @@ -647,7 +647,7 @@ public void PythonNodeHasLabelDisplayingCurrentEngine() DispatcherUtil.DoEvents(); } - [Test] + [TestOnSeparateThread] public void TabWithSpacesMatchesEngine() { // Arrange @@ -696,7 +696,7 @@ public void TabWithSpacesMatchesEngine() StringAssert.StartsWith(" \t", codeEditor.Text); } - [Test] + [TestOnSeparateThread] public void PythonNodeErrorBubblePersists() { // open file @@ -724,7 +724,7 @@ public void PythonNodeErrorBubblePersists() Assert.AreEqual(Visibility.Visible, (errorBubble as UIElement).Visibility); } - [Test] + [TestOnSeparateThread] public void PythonEditorDockingTest() { Open(@"core\python\python.dyn"); @@ -753,7 +753,7 @@ public void PythonEditorDockingTest() /// Tab consists of 4 spaces and every tab yields a new folding /// A folding closes when reaching a line with the same number of tabs it was opened with /// - [Test] + [TestOnSeparateThread] public void AvalonEditTabFoldingStrategyTest() { // Arrange @@ -815,7 +815,7 @@ public override object Evaluate(string code, IList bindingNames, [ArbitraryDimen } } - [Test] + [TestOnSeparateThread] public void OnlyUniqueEnginesAddedToUI() { var node = new PythonNode(); @@ -828,7 +828,7 @@ public void OnlyUniqueEnginesAddedToUI() var menu = nodeView.MainContextMenu.Items.Cast().First(x => (x.Header as string) == PythonNodeModels.Properties.Resources.PythonNodeContextMenuEngineSwitcher); Assert.AreEqual(2, menu.Items.Count); } - [Test] + [TestOnSeparateThread] public void OnlyUniqueEnginesAddedToUI2() { var node = new PythonNode(); diff --git a/test/DynamoCoreWpfTests/SecTabUITests.cs b/test/DynamoCoreWpfTests/SecTabUITests.cs index 2170675fb19..30851eeb0ff 100644 --- a/test/DynamoCoreWpfTests/SecTabUITests.cs +++ b/test/DynamoCoreWpfTests/SecTabUITests.cs @@ -1,4 +1,4 @@ -using Dynamo.Wpf.Views; +using Dynamo.Wpf.Views; using DynamoCoreWpfTests.Utility; using NUnit.Framework; using System; @@ -13,7 +13,7 @@ namespace DynamoCoreWpfTests [TestFixture] public class SecTabUITests: DynamoTestUIBase { - [Test] + [TestOnSeparateThread] public void TestDisableTrustWarningToggle() { var preferencesWindow = new PreferencesView(View); diff --git a/test/DynamoCoreWpfTests/SliderViewModelTests.cs b/test/DynamoCoreWpfTests/SliderViewModelTests.cs index 184f7893716..8a3e1d1da63 100644 --- a/test/DynamoCoreWpfTests/SliderViewModelTests.cs +++ b/test/DynamoCoreWpfTests/SliderViewModelTests.cs @@ -48,7 +48,7 @@ protected override void GetLibrariesToPreload(List libraries) /// public T Min /// public T Step /// - [Test] + [TestOnSeparateThread] public void SliderViewModel_PropertiesTest() { Open(@"core\library\NumberSliderNodeTest.dyn"); @@ -100,7 +100,7 @@ public void SliderViewModel_PropertiesTest() /// /// This test method will validate the "public T Value" property in SliderViewModel.cs /// - [Test] + [TestOnSeparateThread] public void SliderViewModel_ValueTest() { Open(@"core\library\NumberSliderNodeTest.dyn"); @@ -139,7 +139,7 @@ public void SliderViewModel_ValueTest() /// This test will validate that setting the string in a , dec seperator culture does not /// modify the value. /// - [Test] + [TestOnSeparateThread] public void SliderViewModel_ValueTest_Localized() { //change current thread culture to German. diff --git a/test/DynamoCoreWpfTests/SplashScreenTests.cs b/test/DynamoCoreWpfTests/SplashScreenTests.cs index 252f79859cb..818d6552c2b 100644 --- a/test/DynamoCoreWpfTests/SplashScreenTests.cs +++ b/test/DynamoCoreWpfTests/SplashScreenTests.cs @@ -17,7 +17,7 @@ namespace DynamoCoreWpfTests [TestFixture] class SplashScreenViewTests: DynamoTestUIBase { - [Test] + [TestOnSeparateThread] public void SplashScreen_ClosePersistSetsPrefs() { var ss = new Dynamo.UI.Views.SplashScreen(); @@ -63,7 +63,7 @@ public void CleanUp() TestUtilities.WebView2Tag = string.Empty; } - [Test] + [TestOnSeparateThread] public void SplashScreen_CloseExplicitPropIsCorrect1() { var ss = new Dynamo.UI.Views.SplashScreen(); @@ -73,7 +73,7 @@ public void SplashScreen_CloseExplicitPropIsCorrect1() ss.CloseWindow(); } - [Test] + [TestOnSeparateThread] public void SplashScreen_CloseExplicitPropIsCorrect2() { var ss = new Dynamo.UI.Views.SplashScreen(); @@ -82,14 +82,14 @@ public void SplashScreen_CloseExplicitPropIsCorrect2() ss.CloseWindow(); } - [Test] + [TestOnSeparateThread] public void SplashScreen_CloseExplicitPropIsCorrect3() { var ss = new Dynamo.UI.Views.SplashScreen(); ss.CloseWindow(); Assert.IsTrue(ss.CloseWasExplicit); } - [Test] + [TestOnSeparateThread] //note that this test sends a windows close message directly to the window //but skips the JS interop that users rely on to close the window - so that is not tested by this test. public void SplashScreen_MultipleCloseMessages() diff --git a/test/DynamoCoreWpfTests/UnitsUITests.cs b/test/DynamoCoreWpfTests/UnitsUITests.cs index 9e6bc6f270e..ba1e2bafd96 100644 --- a/test/DynamoCoreWpfTests/UnitsUITests.cs +++ b/test/DynamoCoreWpfTests/UnitsUITests.cs @@ -48,7 +48,7 @@ public void TestsSetup() measurementInputBase = new MeasurementInputBaseConcrete(); } - [Test] + [TestOnSeparateThread] public void MigrateLengthFromFeetToMetersTest() { var testDocument = new XmlDocument(); @@ -66,7 +66,7 @@ public void MigrateLengthFromFeetToMetersTest() Assert.AreEqual(oneFeetInMeters, systemDouble.Attributes[0].Value); } - [Test] + [TestOnSeparateThread] public void SerializeCoreTest() { //Loads a value to check @@ -83,7 +83,7 @@ public void SerializeCoreTest() Assert.AreEqual("20", attributeValue); } - [Test] + [TestOnSeparateThread] public void UpdateValueCoreTest() { measurementInputBase.Value = 20; @@ -94,7 +94,7 @@ public void UpdateValueCoreTest() Assert.IsTrue(result); } - [Test] + [TestOnSeparateThread] public void PreferenceSettings_PropertyChanged() { Open(@"UI\UnitsUITests.dyn"); @@ -108,7 +108,7 @@ public void PreferenceSettings_PropertyChanged() Assert.IsTrue(node.IsModified); } - [Test] + [TestOnSeparateThread] public void ForgeUnitsLoadsDefaultsCorrectly() { Open(@"core\units\default_unit_dropdowns.dyn"); @@ -133,7 +133,7 @@ public void ForgeUnitsLoadsDefaultsCorrectly() Assert.AreEqual(-1, node5.SelectedIndex); } - [Test] + [TestOnSeparateThread] public void ForgeUnitsEqualityInDynamoListOps() { Open(@"core\units\unit_dropdowns2.dyn"); @@ -149,7 +149,7 @@ public void ForgeUnitsEqualityInDynamoListOps() } - [Test] + [TestOnSeparateThread] public void ForgeUnitDropdownsLoadWithGoodData() { Open(@"core\units\unit_dropdowns.dyn"); @@ -178,7 +178,7 @@ public void ForgeUnitDropdownsLoadWithGoodData() } - [Test] + [TestOnSeparateThread] //This test loads a modified .dyn to assert the behavior of units/dropdown nodes when schema data changes. public void ForgeUnitDropdownsLoadWithMalformedData() { @@ -210,7 +210,7 @@ public void ForgeUnitDropdownsLoadWithMalformedData() } - [Test] + [TestOnSeparateThread] public void ForgeUnitDropdownsLoadWithDifferentSchemaVersions() { Open(@"core\units\unit_dropdown_different_schema_version.dyn"); @@ -227,7 +227,7 @@ public void ForgeUnitDropdownsLoadWithDifferentSchemaVersions() } - [Test] + [TestOnSeparateThread] //This test loads a modified .dyn to assert the behavior of units/dropdown nodes when schema data is completely missing. public void ForgeUnitDropdownsLoadWithNoSchemas() { @@ -266,7 +266,7 @@ public void ForgeUnitDropdownsLoadWithNoSchemas() DynamoUnits.Utilities.Initialize(); } - [Test] + [TestOnSeparateThread] public void ForgeUnitConversionsReactCorrectly_ToInteractions() { Open(@"core\units\unit_dropdown_different_schema_version.dyn"); diff --git a/test/DynamoCoreWpfTests/Utility/NodeContextMenuBuilderTests.cs b/test/DynamoCoreWpfTests/Utility/NodeContextMenuBuilderTests.cs index e0fea07e96b..c58122fb0a4 100644 --- a/test/DynamoCoreWpfTests/Utility/NodeContextMenuBuilderTests.cs +++ b/test/DynamoCoreWpfTests/Utility/NodeContextMenuBuilderTests.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; using System.Windows.Controls; @@ -13,7 +13,7 @@ public class NodeContextMenuBuilderTests : DynamoTestUIBase /// /// Checks that the Build method constructs the node context menu as expected. /// - [Test] + [TestOnSeparateThread] public void TestBuildContextMenu() { // Arrange @@ -79,7 +79,7 @@ public void TestBuildContextMenu() /// Checks that the NodeContextMenuItemBuilder is able to load MenuItems which come from the /// NodeViewCustomization process. Builds one ContextMenu without custom items, and another with two of them. /// - [Test] + [TestOnSeparateThread] public void AddNodeViewCustomizationMenuItems() { // Arrange @@ -135,7 +135,7 @@ public void AddNodeViewCustomizationMenuItems() /// /// Tests the individual build methods that are part of the NodeContextMenuBuilder. /// - [Test] + [TestOnSeparateThread] public void TestBuildMethods() { // Act @@ -179,7 +179,7 @@ public void TestBuildMethods() /// /// Tests that the AddContextMenuItem method adds the given MenuItem to the target ContextMenu. /// - [Test] + [TestOnSeparateThread] public void TestAddMenuItem() { // Arrange @@ -200,7 +200,7 @@ public void TestAddMenuItem() /// /// Tests that the AddContextMenuSeparator method adds a new Separator to the target ContextMenu. /// - [Test] + [TestOnSeparateThread] public void TestAddSeparator() { // Arrange diff --git a/test/DynamoCoreWpfTests/ViewExtensions/DocumentationBrowserViewExtensionTests.cs b/test/DynamoCoreWpfTests/ViewExtensions/DocumentationBrowserViewExtensionTests.cs index cec44d400d1..91fa8cbe0b1 100644 --- a/test/DynamoCoreWpfTests/ViewExtensions/DocumentationBrowserViewExtensionTests.cs +++ b/test/DynamoCoreWpfTests/ViewExtensions/DocumentationBrowserViewExtensionTests.cs @@ -62,7 +62,7 @@ protected override void GetLibrariesToPreload(List libraries) base.GetLibrariesToPreload(libraries); } - [Test] + [TestOnSeparateThread] public void DocsExtensionAddsMenuItem() { // Arrange @@ -72,7 +72,7 @@ public void DocsExtensionAddsMenuItem() Assert.GreaterOrEqual(showDocsMenuItems.Count, 1); } - [Test] + [TestOnSeparateThread] public void ClickingMenuItemLaunchesSidebarWithIndexContent() { // Act @@ -92,7 +92,7 @@ public void ClickingMenuItemLaunchesSidebarWithIndexContent() Assert.IsTrue(docsBrowserContent.Contains(indexPageHtmlHeader)); } - [Test] + [TestOnSeparateThread] public void ShowingStartPageHidesBrowser() { // Arrange @@ -116,7 +116,7 @@ public void ShowingStartPageHidesBrowser() /// /// This test validates that the Virtual Directory that will be created with WebView2 exists so the images will be loaded for a package node documentation /// - [Test] + [TestOnSeparateThread] public void CanCreatePackageNodeDocumentationAndLoadImages() { // Arrange @@ -155,7 +155,7 @@ public void CanCreatePackageNodeDocumentationAndLoadImages() Assert.IsTrue(htmlContent.Contains(expectedImageContent)); } - [Test] + [TestOnSeparateThread] public void ViewExtensionIgnoresExternalEvents() { // Arrange @@ -177,7 +177,7 @@ public void ViewExtensionIgnoresExternalEvents() } } - [Test] + [TestOnSeparateThread] public void CanHandleDocsEventWithValidLink() { // Arrange @@ -197,7 +197,7 @@ public void CanHandleDocsEventWithValidLink() } } - [Test] + [TestOnSeparateThread] public void CanHandleDocsEventTriggeredFromDynamoViewModel() { // Arrange @@ -219,7 +219,7 @@ public void CanHandleDocsEventTriggeredFromDynamoViewModel() Assert.IsTrue(htmlContent.Contains(excelDocsFileHtmlHeader)); } - [Test] + [TestOnSeparateThread] public void CanHandleDocsEventTriggeredFromDynamoViewModelMultipleTimes() { // Arrange @@ -243,7 +243,7 @@ public void CanHandleDocsEventTriggeredFromDynamoViewModelMultipleTimes() Assert.IsTrue(htmlContent.Contains(excelDocsFileHtmlHeader)); } - [Test] + [TestOnSeparateThread] public void Displays404PageOnMissingDocFile() { // Arrange @@ -263,7 +263,7 @@ public void Displays404PageOnMissingDocFile() } } - [Test] + [TestOnSeparateThread] public void DisplaysHtmlEmbeddedInLoadedAssemblies() { // Arrange @@ -290,7 +290,7 @@ public void DisplaysHtmlEmbeddedInLoadedAssemblies() } - [Test] + [TestOnSeparateThread] public void Displays404PageWhenLinkPointsToAssemblyThatCannotBeFound() { // Arrange @@ -320,7 +320,7 @@ public void Displays404PageWhenLinkPointsToAssemblyThatCannotBeFound() /// Test with Dynamo running in "en-us" culture and help content requested /// for a package that contains localized help content for "en-us". /// - [Test] + [TestOnSeparateThread] public void DisplaysLocalizedContentWhenAvailable() { // Arrange @@ -354,7 +354,7 @@ public void DisplaysLocalizedContentWhenAvailable() /// for a package that doesn't contain localized help content for "es-uy", /// but does contain help content for neutral culture "es". /// - [Test] + [TestOnSeparateThread] public void DisplayNeutralCultureContentWhenSpecificCultureContentIsNotAvailable() { // Arrange @@ -386,7 +386,7 @@ public void DisplayNeutralCultureContentWhenSpecificCultureContentIsNotAvailable /// for a package that doesn't contain localized help content for "en", /// but does contain help content for specific culture "en-us". /// - [Test] + [TestOnSeparateThread] public void DisplaySpecificCultureContentWhenNeutralCultureContentIsNotAvailable() { // Arrange @@ -419,7 +419,7 @@ public void DisplaySpecificCultureContentWhenNeutralCultureContentIsNotAvailable /// nor the neutral culture "fr", so it falls back to invariant culture /// help content. /// - [Test] + [TestOnSeparateThread] public void DisplaysInvariantContentWhenNoCompatibleLocalizedContentIsAvailable() { // Arrange @@ -446,7 +446,7 @@ public void DisplaysInvariantContentWhenNoCompatibleLocalizedContentIsAvailable( } } - [Test] + [TestOnSeparateThread] public void RemovesScriptTagsFromLoadedHtml() { // Arrange @@ -473,7 +473,7 @@ public void RemovesScriptTagsFromLoadedHtml() } } - [Test] + [TestOnSeparateThread] public void DPIScriptExists() { // Arrange @@ -499,7 +499,7 @@ public void DPIScriptExists() } } - [Test] + [TestOnSeparateThread] public void GetResourceNameWithCultureNameReturnsSameAsInputWhenCultureIsNull() { var name = "MyPage.html"; @@ -507,7 +507,7 @@ public void GetResourceNameWithCultureNameReturnsSameAsInputWhenCultureIsNull() Assert.AreEqual(name, result); } - [Test] + [TestOnSeparateThread] public void GetResourceNameWithCultureNameReturnsSameAsInputWhenItDoesNotHaveAnExtension() { var name = "NotAPage"; @@ -515,7 +515,7 @@ public void GetResourceNameWithCultureNameReturnsSameAsInputWhenItDoesNotHaveAnE Assert.AreEqual(name, result); } - [Test] + [TestOnSeparateThread] public void GetResourceNameWithCultureNameWorksWithValidCultureAndInputName() { var name = "MyPage.html"; @@ -523,7 +523,7 @@ public void GetResourceNameWithCultureNameWorksWithValidCultureAndInputName() Assert.AreEqual("MyPage.en-US.html", result); } - [Test] + [TestOnSeparateThread] public void CanCreateNodeDocumenationHtmlFromNodeAnnotationEventArgsWithOOTBNodeWithoutAddtionalDocumentation() { // Arrange @@ -562,7 +562,7 @@ public void CanCreateNodeDocumenationHtmlFromNodeAnnotationEventArgsWithOOTBNode Assert.IsTrue(htmlContent.Contains(nodeDocumentationInfoNodeOutputs)); } - [Test] + [TestOnSeparateThread] public void CanCreateNodeDocumenationHtmlFromNodeAnnotationEventArgsWithPackageNodeWithAddtionalDocumentation() { // Arrange @@ -613,7 +613,7 @@ public void CanCreateNodeDocumenationHtmlFromNodeAnnotationEventArgsWithPackageN Assert.IsTrue(htmlContent.Contains(expectedAddtionalNodeDocumentationImage)); } - [Test] + [TestOnSeparateThread] public void CanGetNodeDocumentationMarkdownFromPackageDocumentationManager() { // Arrange @@ -626,7 +626,7 @@ public void CanGetNodeDocumentationMarkdownFromPackageDocumentationManager() Assert.That(!PackageDocumentationManager.Instance.ContainsAnnotationDoc(Path.Combine(packageName, nodeWithoutDocumentation))); } - [Test] + [TestOnSeparateThread] public void DocsCanBeLoadedForDSNonPackageNodesFrom_FallBackPath() { //setup the docs browser to point to our fake fallback folder. @@ -659,7 +659,7 @@ public void DocsCanBeLoadedForDSNonPackageNodesFrom_FallBackPath() Assert.IsTrue(htmlContent.Contains("loopwhile sample docs")); } - [Test] + [TestOnSeparateThread] public void DocsAreLoadedFromHostPathBeforeCorePath() { //setup the docs browser to point to our fake fallback folder. @@ -683,7 +683,7 @@ public void DocsAreLoadedFromHostPathBeforeCorePath() Assert.IsTrue(htmlContent.Contains("list.rank sample docs from host path")); } - [Test] + [TestOnSeparateThread] public void DocsCanBeLoadedForCoreNodeModelNodesFrom_FallBackPath() { //setup the docs browser to point to our fake fallback folder. @@ -750,7 +750,7 @@ private string RequestDocLink(DocumentationBrowserViewExtension viewExtension, O return GetSidebarDocsBrowserContents(); } - [Test] + [TestOnSeparateThread] public void AddGraphInSpecificLocationToWorkspace() { //TODO see this issue: @@ -803,7 +803,7 @@ public void AddGraphInSpecificLocationToWorkspace() DispatcherUtil.DoEvents(); } - [Test] + [TestOnSeparateThread] public void Validate_GetGraphLinkFromMDLocation() { var nodeName = "Number"; @@ -836,7 +836,7 @@ public void Validate_GetGraphLinkFromMDLocation() //check that the pathPath contains "NodeHelpSharedDocs//dynfilename" Assert.That(graphPathValue.Contains(sharedFilesPath)); } - [Test] + [TestOnSeparateThread] public void Validate_GetGraphLinkFromPackage() { var nodeName = "Package.Hello"; diff --git a/test/DynamoCoreWpfTests/ViewExtensions/GraphMetadataViewExtensionTests.cs b/test/DynamoCoreWpfTests/ViewExtensions/GraphMetadataViewExtensionTests.cs index 125a20dce05..82f3e656e10 100644 --- a/test/DynamoCoreWpfTests/ViewExtensions/GraphMetadataViewExtensionTests.cs +++ b/test/DynamoCoreWpfTests/ViewExtensions/GraphMetadataViewExtensionTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -14,7 +14,7 @@ namespace DynamoCoreWpfTests.ViewExtensions { public class GraphMetadataViewExtensionTests : DynamoTestUIBase { - [Test] + [TestOnSeparateThread] public void SettingPropertiesInExtensionUpdatesWorkspace() { // Arrange @@ -68,7 +68,7 @@ public void SettingPropertiesInExtensionUpdatesWorkspace() Assert.IsTrue(hwm.Thumbnail == thumbnailB64); } - [Test] + [TestOnSeparateThread] public void CustomPropertiesGetsAddedToExtensionDataOnSave() { // Arrange @@ -101,7 +101,7 @@ public void CustomPropertiesGetsAddedToExtensionDataOnSave() } - [Test] + [TestOnSeparateThread] public void ExistingGraphWithCustomPropertiesWillBeAddedToExtension() { // Arrange @@ -134,7 +134,7 @@ public void ExistingGraphWithCustomPropertiesWillBeAddedToExtension() Assert.That(propertiesExt.viewModel.CustomProperties[2].PropertyValue == expectedCP3Value); } - [Test] + [TestOnSeparateThread] public void ExistingGraphOpenModifiedAndClosedWillSetAndClearModifiedFlag() { var extensionManager = View.viewExtensionManager; diff --git a/test/DynamoCoreWpfTests/ViewExtensions/GraphNodeManagerViewExtensionTests.cs b/test/DynamoCoreWpfTests/ViewExtensions/GraphNodeManagerViewExtensionTests.cs index cc2e3295f4b..a5aae83a5d6 100644 --- a/test/DynamoCoreWpfTests/ViewExtensions/GraphNodeManagerViewExtensionTests.cs +++ b/test/DynamoCoreWpfTests/ViewExtensions/GraphNodeManagerViewExtensionTests.cs @@ -81,7 +81,7 @@ public void Teardown() /// /// Test if the Extension loads correctly /// - [Test] + [TestOnSeparateThread] public void ViewExtensionOpenTest() { var extensionManager = View.viewExtensionManager; @@ -103,7 +103,7 @@ public void ViewExtensionOpenTest() /// /// Test if the number of nodes displayed in the extension is equal to current number of nodes /// - [Test] + [TestOnSeparateThread] public void CorrectNumberNodeItemsTest() { var extensionManager = View.viewExtensionManager; @@ -147,7 +147,7 @@ public void CorrectNumberNodeItemsTest() /// /// Test if using the IsFrozen filter yields correct results /// - [Test] + [TestOnSeparateThread] public void FilterFrozenItemsTest() { var extensionManager = View.viewExtensionManager; @@ -193,7 +193,7 @@ public void FilterFrozenItemsTest() /// Test if the number of Nodes containing Null or Empty List matches what is shown on the UI /// Marked as Failure until we can fix flakyness /// - [Test] + [TestOnSeparateThread] public void ContainsEmptyListOrNullTest() { var extensionManager = View.viewExtensionManager; @@ -228,7 +228,7 @@ public void ContainsEmptyListOrNullTest() /// /// Test if the Extension loads correctly when remembered /// - [Test] + [TestOnSeparateThread] public void ViewExtensionOpensWithDynamoWhenRememberedTest() { ViewModel.PreferenceSettings.EnablePersistExtensions = true; @@ -260,7 +260,7 @@ public void ViewExtensionOpensWithDynamoWhenRememberedTest() /// /// Test if the Extension does not open when closed in the last session, and remember setting was enabled. /// - [Test] + [TestOnSeparateThread] public void ViewExtensionDoesNotOpensWithDynamoWhenClosedTest() { ViewModel.PreferenceSettings.EnablePersistExtensions = true; @@ -296,7 +296,7 @@ public void ViewExtensionDoesNotOpensWithDynamoWhenClosedTest() /// /// Test if the Extension loads correctly when remembered /// - [Test] + [TestOnSeparateThread] public void ViewExtensionDoesNotOpenWhenNotRememberedTest() { ViewModel.PreferenceSettings.EnablePersistExtensions = false; diff --git a/test/DynamoCoreWpfTests/ViewExtensions/NodeAutoCompleteViewExtensionTests.cs b/test/DynamoCoreWpfTests/ViewExtensions/NodeAutoCompleteViewExtensionTests.cs index 70a0f64cc49..35df924ee2b 100644 --- a/test/DynamoCoreWpfTests/ViewExtensions/NodeAutoCompleteViewExtensionTests.cs +++ b/test/DynamoCoreWpfTests/ViewExtensions/NodeAutoCompleteViewExtensionTests.cs @@ -1,4 +1,4 @@ -using Dynamo.NodeAutoComplete; +using Dynamo.NodeAutoComplete; using NUnit.Framework; namespace DynamoCoreWpfTests.ViewExtensions @@ -7,7 +7,7 @@ class NodeAutoCompleteViewExtensionTests : DynamoTestUIBase { private NodeAutoCompleteViewExtension viewExtension = new NodeAutoCompleteViewExtension(); - [Test] + [TestOnSeparateThread] public void TestPropertiesWithCodeInit() { Assert.AreEqual("Node Auto Complete", viewExtension.Name); diff --git a/test/DynamoCoreWpfTests/ViewExtensions/NodeManipulatorExtensionTests.cs b/test/DynamoCoreWpfTests/ViewExtensions/NodeManipulatorExtensionTests.cs index 22a1499250e..4d184621e04 100644 --- a/test/DynamoCoreWpfTests/ViewExtensions/NodeManipulatorExtensionTests.cs +++ b/test/DynamoCoreWpfTests/ViewExtensions/NodeManipulatorExtensionTests.cs @@ -42,7 +42,7 @@ protected override void GetLibrariesToPreload(List libraries) base.GetLibrariesToPreload(libraries); } - [Test] + [TestOnSeparateThread] public void GizmoWarningTest() { RaiseLoadedEvent(this.View); @@ -71,7 +71,7 @@ public void GizmoWarningTest() Assert.IsTrue(pntNode.Infos.Any(x => x.Message.Equals("TestPersistentWarning") && x.State == ElementState.PersistentWarning)); } - [Test] + [TestOnSeparateThread] public void NodeManipulatorUnselectedNodeTest() { RaiseLoadedEvent(this.View); diff --git a/test/DynamoCoreWpfTests/ViewExtensions/NotificationsExtensionTests.cs b/test/DynamoCoreWpfTests/ViewExtensions/NotificationsExtensionTests.cs index 54915f00909..6bbfb0aea58 100644 --- a/test/DynamoCoreWpfTests/ViewExtensions/NotificationsExtensionTests.cs +++ b/test/DynamoCoreWpfTests/ViewExtensions/NotificationsExtensionTests.cs @@ -14,7 +14,7 @@ namespace DynamoCoreWpfTests.ViewExtensions { public class NotificationsExtensionTests : DynamoTestUIBase { - [Test] + [TestOnSeparateThread] public void PressNotificationButtonAndShowPopup() { var shortcutBar = this.View.ShortcutBar; @@ -42,7 +42,7 @@ public void PressNotificationButtonAndShowPopup() Assert.NotNull(webView, "WebView framework element not found."); } - [Test] + [TestOnSeparateThread] public void ValidateNotificationsUIEmbededFiles() { var assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(x=>x.ManifestModule.Name.Contains("Notifications.dll")); diff --git a/test/DynamoCoreWpfTests/ViewExtensions/ViewExtensionTests.cs b/test/DynamoCoreWpfTests/ViewExtensions/ViewExtensionTests.cs index e918014ec48..d10ac640259 100644 --- a/test/DynamoCoreWpfTests/ViewExtensions/ViewExtensionTests.cs +++ b/test/DynamoCoreWpfTests/ViewExtensions/ViewExtensionTests.cs @@ -17,7 +17,7 @@ public class ViewExtensionTests : DynamoTestUIBase private ExtensionsSideBarViewExtension extensionsSideBarViewExtension = new ExtensionsSideBarViewExtension(); private ExtensionsSideBarViewExtension extensionsSideBarViewExtensionNew = new ExtensionsSideBarViewExtension(); - [Test] + [TestOnSeparateThread] public void OnWorkspaceChangedExtensionIsNotified() { this.View.WindowState = WindowState.Maximized; @@ -33,7 +33,7 @@ public void OnWorkspaceChangedExtensionIsNotified() Assert.AreEqual(2, viewExtension.Counter); } - [Test] + [TestOnSeparateThread] public void ExtensionWindowIsClosedWithDynamo() { var dummyExtension = new DummyViewExtension() @@ -50,7 +50,7 @@ public void ExtensionWindowIsClosedWithDynamo() Assert.IsTrue(dummyExtension.WindowClosed); } - [Test] + [TestOnSeparateThread] public void ExtensionsSideBarExtensionsTest() { RaiseLoadedEvent(this.View); @@ -74,7 +74,7 @@ public void ExtensionsSideBarExtensionsTest() Assert.AreEqual(initialNum + 2, ViewModel.SideBarTabItems.Count); } - [Test] + [TestOnSeparateThread] public void CloseViewExtensionTest() { RaiseLoadedEvent(this.View); @@ -94,7 +94,7 @@ public void CloseViewExtensionTest() Assert.AreEqual(initialNum, ViewModel.SideBarTabItems.Count); } - [Test] + [TestOnSeparateThread] public void ExtensionSideBarIsUncollapsedOnActivation() { RaiseLoadedEvent(this.View); @@ -117,7 +117,7 @@ public void ExtensionSideBarIsUncollapsedOnActivation() Assert.IsFalse(View.ExtensionsCollapsed); } - [Test] + [TestOnSeparateThread] public void ExtensionNotEnabledLoadingTest() { RaiseLoadedEvent(this.View); @@ -132,7 +132,7 @@ public void ExtensionNotEnabledLoadingTest() Assert.IsNull(loader.Load(ext)); } - [Test] + [TestOnSeparateThread] public void ExtensionFromManifestNotEnabledLoadingTest() { RaiseLoadedEvent(this.View); @@ -143,7 +143,7 @@ public void ExtensionFromManifestNotEnabledLoadingTest() Assert.IsNull(loader.Load(Path.Combine(GetTestDirectory(ExecutingDirectory), @"DynamoCoreWpfTests\ViewExtensions\Sample Manifests\Sample_ViewExtensionDefinition.xml"))); } - [Test] + [TestOnSeparateThread] public void ExtensionUndockRedock() { RaiseLoadedEvent(this.View); @@ -190,7 +190,7 @@ public void ExtensionUndockRedock() Assert.AreEqual("Dummy", content.Text); } - [Test] + [TestOnSeparateThread] public void ExtensionUndockClose() { RaiseLoadedEvent(this.View); @@ -231,7 +231,7 @@ public void ExtensionUndockClose() Assert.AreEqual(0, View.ExtensionWindows.Count); } - [Test] + [TestOnSeparateThread] public void ExtensionDockAndUndockWithRandomGUID() { RaiseLoadedEvent(this.View); @@ -248,7 +248,7 @@ public void ExtensionDockAndUndockWithRandomGUID() Assert.DoesNotThrow(() => View.UndockExtension(extensionsSideBarViewExtension.Name)); } - [Test] + [TestOnSeparateThread] public void ExtensionCannotBeAddedAsBothWindowAndTab() { RaiseLoadedEvent(this.View); @@ -277,7 +277,7 @@ public void ExtensionCannotBeAddedAsBothWindowAndTab() Assert.IsTrue(View.ExtensionsCollapsed); } - [Test] + [TestOnSeparateThread] public void ExtensionLocationIsRemembered() { RaiseLoadedEvent(this.View); @@ -355,7 +355,7 @@ public static void RaiseLoadedEvent(FrameworkElement element) /// /// Test if the number of nodes displayed in the extension is equal to current number of nodes /// - [Test] + [TestOnSeparateThread] public void TestGraphEvaluationEvents() { RaiseLoadedEvent(this.View); diff --git a/test/DynamoCoreWpfTests/ViewExtensions/WorkspaceDependencyViewExtensionTests.cs b/test/DynamoCoreWpfTests/ViewExtensions/WorkspaceDependencyViewExtensionTests.cs index 082e38382ea..78eb69bb4f7 100644 --- a/test/DynamoCoreWpfTests/ViewExtensions/WorkspaceDependencyViewExtensionTests.cs +++ b/test/DynamoCoreWpfTests/ViewExtensions/WorkspaceDependencyViewExtensionTests.cs @@ -52,7 +52,7 @@ protected override void GetLibrariesToPreload(List libraries) base.GetLibrariesToPreload(libraries); } - [Test] + [TestOnSeparateThread] public void RestartBannerDefaultStateTest() { RaiseLoadedEvent(this.View); @@ -72,7 +72,7 @@ public void RestartBannerDefaultStateTest() } - [Test] + [TestOnSeparateThread] public void DownloadSpecifiedVersionOfPackageTest() { RaiseLoadedEvent(this.View); @@ -109,7 +109,7 @@ public void DownloadSpecifiedVersionOfPackageTest() /// This test is created to guard the clicking behavior on tab closing button /// and make sure it actually close the corresponding tab /// - [Test] + [TestOnSeparateThread] public void ClickingToCloseViewExtensionTabTest() { RaiseLoadedEvent(this.View); @@ -128,7 +128,7 @@ public void ClickingToCloseViewExtensionTabTest() /// This test is created to guard the tab closing API - CloseExtensioninInSideBar() /// and make sure it actually close the corresponding tab /// - [Test] + [TestOnSeparateThread] public void APItoCloseViewExtensionTabTest() { RaiseLoadedEvent(this.View); @@ -146,7 +146,7 @@ public void APItoCloseViewExtensionTabTest() /// /// This test will verify that the Closed() will be triggered on the extension that is closed. /// - [Test] + [TestOnSeparateThread] public void OnViewExtensionClosedTest() { RaiseLoadedEvent(this.View); @@ -174,7 +174,7 @@ public void OnViewExtensionClosedTest() /// /// This test will make sure that the extension tab is closed upon closing the home workspace. /// - [Test] + [TestOnSeparateThread] public void CloseViewExtensionTabOnClosingWorkspace() { RaiseLoadedEvent(this.View); @@ -192,7 +192,7 @@ public void CloseViewExtensionTabOnClosingWorkspace() /// This test is created to guard a crash happened that while dep viewer is loaded, /// opening a dyf directly and closing it to switch to an empty homeworkspace causing a crash /// - [Test] + [TestOnSeparateThread] public void DependencyRegenCrashingDynamoTest() { this.View.WindowState = WindowState.Maximized; @@ -218,7 +218,7 @@ public void DependencyRegenCrashingDynamoTest() Assert.DoesNotThrow(()=> viewExtension.DependencyRegen(homeWorkspaceModel)); } - [Test] + [TestOnSeparateThread] public void KeepInstalledVersionOfPackageTest() { RaiseLoadedEvent(this.View); @@ -258,7 +258,7 @@ public void KeepInstalledVersionOfPackageTest() Assert.AreEqual(package.Nodes.Select(n => n.ToString("N")), nodes); } - [Test] + [TestOnSeparateThread] public void WillNotAddDupWorkspaceDependencyViewExtensionLoadTest() { RaiseLoadedEvent(this.View); @@ -274,7 +274,7 @@ public void WillNotAddDupWorkspaceDependencyViewExtensionLoadTest() Assert.AreEqual(initialNum, ViewModel.SideBarTabItems.Count); } - [Test] + [TestOnSeparateThread] public void TestPropertiesWithCodeInIt() { Assert.AreEqual(Resources.ExtensionName, viewExtension.Name); @@ -282,7 +282,7 @@ public void TestPropertiesWithCodeInIt() Assert.AreEqual("A6706BF5-11C2-458F-B7C8-B745A77EF7FD", viewExtension.UniqueId); } - [Test] + [TestOnSeparateThread] public void VerifyDynamoLoadingOnOpeningWorkspaceWithMissingCustomNodes() { List dependenciesList = new List() { "MeshToolkit", "Clockwork for Dynamo 1.x", "Clockwork for Dynamo 2.x", "Dynamo Samples" }; @@ -299,7 +299,7 @@ public void VerifyDynamoLoadingOnOpeningWorkspaceWithMissingCustomNodes() } } - [Test] + [TestOnSeparateThread] public void VerifyLocalDefinitions() { List dependenciesList = new List() { "RootNode.dyf"}; @@ -321,7 +321,7 @@ public void VerifyLocalDefinitions() Assert.Contains(dependencyInfo.Name, dependenciesList); } - [Test] + [TestOnSeparateThread] public void VerifyExternalFileReferences() { List dependenciesList = new List() { "DynamoTest.xlsx", "Dynamo.png" }; @@ -340,7 +340,7 @@ public void VerifyExternalFileReferences() } } - [Test] + [TestOnSeparateThread] public void GetExternalFilesShouldBailIfGraphExecuting() { // Open test file to verify the external file references are not computed when RunEnabled is false. diff --git a/test/ViewExtensionLibraryTests/LibraryViewControllerTests.cs b/test/ViewExtensionLibraryTests/LibraryViewControllerTests.cs index f9abe1dfecb..421b13908db 100644 --- a/test/ViewExtensionLibraryTests/LibraryViewControllerTests.cs +++ b/test/ViewExtensionLibraryTests/LibraryViewControllerTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -42,7 +42,7 @@ protected override void GetLibrariesToPreload(List libraries) libraries.Add("DSCPython.dll"); } - [Test] + [TestOnSeparateThread] [Category("UnitTests"), Category("Failure")] public void CreatingNodeCustomNodeDefinitionOrUpdatingItShouldRaiseUpdate() { @@ -96,7 +96,7 @@ public void CreatingNodeCustomNodeDefinitionOrUpdatingItShouldRaiseUpdate() } - [Test] + [TestOnSeparateThread] [Category("UnitTests"), Category("Failure")] public void InstantiatingLazyLoadedCustomNodeShouldNotRaiseUpdate() {