From fa35474f8c71e19d220ae32faa0abbc8399508fe Mon Sep 17 00:00:00 2001 From: pinzart Date: Sat, 16 Dec 2023 00:14:02 -0500 Subject: [PATCH 01/10] update --- .../SystemTestServices/SystemTestBase.cs | 3 +- test/Libraries/TestServices/App.config | 7 ++++ .../DynamoVisualProgramming.Core.targets | 8 +++++ .../DynamoVisualProgramming.Tests.props | 9 +++++ ...VisualProgramming.ZeroTouchLibrary.targets | 8 +++++ .../DynamoVisualProgramming.Core.nuspec | 36 ++++++++++++------- .../DynamoVisualProgramming.Tests.nuspec | 14 ++++++-- ...oVisualProgramming.ZeroTouchLibrary.nuspec | 15 +++++++- 8 files changed, 82 insertions(+), 18 deletions(-) create mode 100644 test/Libraries/TestServices/App.config create mode 100644 tools/NuGet/build_props/DynamoVisualProgramming.Core.targets create mode 100644 tools/NuGet/build_props/DynamoVisualProgramming.Tests.props create mode 100644 tools/NuGet/build_props/DynamoVisualProgramming.ZeroTouchLibrary.targets diff --git a/test/Libraries/SystemTestServices/SystemTestBase.cs b/test/Libraries/SystemTestServices/SystemTestBase.cs index 774a09abb68..60c7ff68cef 100644 --- a/test/Libraries/SystemTestServices/SystemTestBase.cs +++ b/test/Libraries/SystemTestServices/SystemTestBase.cs @@ -194,7 +194,8 @@ protected virtual void StartDynamo(TestSessionConfiguration testConfig) StartInTestMode = true, PathResolver = pathResolver, GeometryFactoryPath = preloader.GeometryFactoryPath, - ProcessMode = TaskProcessMode.Synchronous + ProcessMode = TaskProcessMode.Synchronous, + DynamoCorePath = testConfig.DynamoCorePath }); ViewModel = DynamoViewModel.Start( diff --git a/test/Libraries/TestServices/App.config b/test/Libraries/TestServices/App.config new file mode 100644 index 00000000000..9e99b51fd0b --- /dev/null +++ b/test/Libraries/TestServices/App.config @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tools/NuGet/build_props/DynamoVisualProgramming.Core.targets b/tools/NuGet/build_props/DynamoVisualProgramming.Core.targets new file mode 100644 index 00000000000..68c9f4a4f16 --- /dev/null +++ b/tools/NuGet/build_props/DynamoVisualProgramming.Core.targets @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/tools/NuGet/build_props/DynamoVisualProgramming.Tests.props b/tools/NuGet/build_props/DynamoVisualProgramming.Tests.props new file mode 100644 index 00000000000..b9be3bf82b4 --- /dev/null +++ b/tools/NuGet/build_props/DynamoVisualProgramming.Tests.props @@ -0,0 +1,9 @@ + + + + TestServices.dll.config + Always + True + + + diff --git a/tools/NuGet/build_props/DynamoVisualProgramming.ZeroTouchLibrary.targets b/tools/NuGet/build_props/DynamoVisualProgramming.ZeroTouchLibrary.targets new file mode 100644 index 00000000000..68c9f4a4f16 --- /dev/null +++ b/tools/NuGet/build_props/DynamoVisualProgramming.ZeroTouchLibrary.targets @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/tools/NuGet/template-nuget/DynamoVisualProgramming.Core.nuspec b/tools/NuGet/template-nuget/DynamoVisualProgramming.Core.nuspec index bd2127d8cd4..273bceabaeb 100644 --- a/tools/NuGet/template-nuget/DynamoVisualProgramming.Core.nuspec +++ b/tools/NuGet/template-nuget/DynamoVisualProgramming.Core.nuspec @@ -10,27 +10,15 @@ content\images\logo.png false - Assemblies required to start a DynamoModel and execute DesignScript code. Contains the following files: - 1) DynamoApplications.dll - 2) DynamoCore.dll - 3) DynamoInstallDetective.dll - 4) DynamoShapeManager.dll - 5) DynamoUtilities.dll - 6) ProtoCore.dll - 7) DesignScriptBuiltin.dll - 8) VMDataBridge.dll - 9) DSCPython.dll - 10) DynamoPackages.dll + Assemblies required to start a DynamoModel and execute DesignScript code. This package contains the core assemblies for Dynamo. Copyright Autodesk 2023 - - @@ -38,23 +26,45 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/NuGet/template-nuget/DynamoVisualProgramming.Tests.nuspec b/tools/NuGet/template-nuget/DynamoVisualProgramming.Tests.nuspec index 2e1ccddb92c..b32d9f53dd9 100644 --- a/tools/NuGet/template-nuget/DynamoVisualProgramming.Tests.nuspec +++ b/tools/NuGet/template-nuget/DynamoVisualProgramming.Tests.nuspec @@ -18,14 +18,22 @@ + + + + + - - - + + + + + + diff --git a/tools/NuGet/template-nuget/DynamoVisualProgramming.ZeroTouchLibrary.nuspec b/tools/NuGet/template-nuget/DynamoVisualProgramming.ZeroTouchLibrary.nuspec index b756cebe764..27aec560eac 100644 --- a/tools/NuGet/template-nuget/DynamoVisualProgramming.ZeroTouchLibrary.nuspec +++ b/tools/NuGet/template-nuget/DynamoVisualProgramming.ZeroTouchLibrary.nuspec @@ -24,9 +24,22 @@ + - + + + + + + + + + + + + + From 2492efdcbb84e576c0ccb51457b2aeafe6ef976d Mon Sep 17 00:00:00 2001 From: pinzart Date: Tue, 19 Dec 2023 10:49:19 -0500 Subject: [PATCH 02/10] update --- test/Libraries/TestServices/App.config | 2 +- .../template-nuget/DynamoVisualProgramming.Tests.nuspec | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/Libraries/TestServices/App.config b/test/Libraries/TestServices/App.config index 9e99b51fd0b..0d8d234ba38 100644 --- a/test/Libraries/TestServices/App.config +++ b/test/Libraries/TestServices/App.config @@ -2,6 +2,6 @@ - + diff --git a/tools/NuGet/template-nuget/DynamoVisualProgramming.Tests.nuspec b/tools/NuGet/template-nuget/DynamoVisualProgramming.Tests.nuspec index b32d9f53dd9..8dd8286d5dd 100644 --- a/tools/NuGet/template-nuget/DynamoVisualProgramming.Tests.nuspec +++ b/tools/NuGet/template-nuget/DynamoVisualProgramming.Tests.nuspec @@ -28,10 +28,10 @@ - - - - + + + + From 55c487dced1ff9d884ac02e95b9d9bb57bb620d0 Mon Sep 17 00:00:00 2001 From: pinzart Date: Tue, 19 Dec 2023 12:18:59 -0500 Subject: [PATCH 03/10] Update DynamoVisualProgramming.WpfUILibrary.nuspec --- .../DynamoVisualProgramming.WpfUILibrary.nuspec | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tools/NuGet/template-nuget/DynamoVisualProgramming.WpfUILibrary.nuspec b/tools/NuGet/template-nuget/DynamoVisualProgramming.WpfUILibrary.nuspec index 84a8254e081..a75a48c7f1a 100644 --- a/tools/NuGet/template-nuget/DynamoVisualProgramming.WpfUILibrary.nuspec +++ b/tools/NuGet/template-nuget/DynamoVisualProgramming.WpfUILibrary.nuspec @@ -16,12 +16,6 @@ This package contains all that is required to get up and running building nodes for the Dynamo Visual Programming language with custom UI in WPF. Copyright Autodesk 2023 - - - - - - From d41dea2d628c94c0cf17eabc4d56535e5107c426 Mon Sep 17 00:00:00 2001 From: pinzart Date: Fri, 22 Dec 2023 13:32:55 -0500 Subject: [PATCH 04/10] update --- .../SystemTestServices/SystemTestBase.cs | 26 ++++++----------- .../TestServices/TestSessionConfiguration.cs | 22 ++++++++++++++- .../DynamoVisualProgramming.Core.nuspec | 28 ++----------------- ...moVisualProgramming.DynamoCoreNodes.nuspec | 8 +----- ...ynamoVisualProgramming.WpfUILibrary.nuspec | 4 +-- ...oVisualProgramming.ZeroTouchLibrary.nuspec | 17 ++--------- 6 files changed, 35 insertions(+), 70 deletions(-) diff --git a/test/Libraries/SystemTestServices/SystemTestBase.cs b/test/Libraries/SystemTestServices/SystemTestBase.cs index 60c7ff68cef..b5a3abd413d 100644 --- a/test/Libraries/SystemTestServices/SystemTestBase.cs +++ b/test/Libraries/SystemTestServices/SystemTestBase.cs @@ -34,8 +34,8 @@ public abstract class SystemTestBase { protected IPathResolver pathResolver; protected string workingDirectory; + private TestSessionConfiguration testConfig; private Preloader preloader; - private AssemblyResolver assemblyResolver; // Some tests override the static property PathManager.BuiltinPackagesDirectory, so we need a way to reset it after each test. private string originalBuiltinPackagesDirectory; @@ -56,21 +56,17 @@ protected string ExecutingDirectory #endregion + public SystemTestBase() + { + testConfig = new TestSessionConfiguration(); + } + #region public methods [SetUp] public virtual void Setup() { System.Console.WriteLine("Start test: " + TestContext.CurrentContext.Test.Name); - var testConfig = GetTestSessionConfiguration(); - - if (assemblyResolver == null) - { - assemblyResolver = new AssemblyResolver(); - assemblyResolver.Setup(testConfig.DynamoCorePath, new [] { - Path.Combine(testConfig.DynamoCorePath, "nodes") - }); - } SetupCore(); @@ -97,7 +93,7 @@ public virtual void Setup() /// protected virtual TestSessionConfiguration GetTestSessionConfiguration() { - return new TestSessionConfiguration(); + return testConfig; } [TearDown] @@ -123,12 +119,6 @@ public virtual void TearDown() preloader = null; pathResolver = null; - if (assemblyResolver != null) - { - assemblyResolver.TearDown(); - assemblyResolver = null; - } - PathManager.BuiltinPackagesDirectory = originalBuiltinPackagesDirectory; try { @@ -306,7 +296,7 @@ public void AssertPreviewCount(string guid, int count) Assert.AreEqual(count, data.GetElements().ToList().Count); } - public NodeModel GetNode(string guid) where T : NodeModel + protected T GetNode(string guid) where T : class { var allNodes = ViewModel.Model.CurrentWorkspace.Nodes; var nodes = allNodes.Where(x => string.CompareOrdinal(x.GUID.ToString(), guid) == 0); diff --git a/test/Libraries/TestServices/TestSessionConfiguration.cs b/test/Libraries/TestServices/TestSessionConfiguration.cs index 54404deedd8..e877e3dd895 100644 --- a/test/Libraries/TestServices/TestSessionConfiguration.cs +++ b/test/Libraries/TestServices/TestSessionConfiguration.cs @@ -15,6 +15,7 @@ namespace TestServices /// public class TestSessionConfiguration { + private AssemblyResolver assemblyResolver = new AssemblyResolver(); private const string CONFIG_FILE_NAME = "TestServices.dll.config"; private List supportedLibGVersions = new List { @@ -22,7 +23,26 @@ public class TestSessionConfiguration new Version(229,0,0), }; - public string DynamoCorePath { get; private set; } + private string dynamoCorePath; + + public string DynamoCorePath + { + get => dynamoCorePath; + private set + { + if (!string.IsNullOrEmpty(dynamoCorePath)) + { + // if we have an assembly resolver, try to clean it first. + assemblyResolver?.TearDown(); + } + dynamoCorePath = value; + + // setup the assembly resolver + assemblyResolver?.Setup(dynamoCorePath, new[] { + Path.Combine(dynamoCorePath, "nodes") + }); + } + } [Obsolete("Please use the Version2 Property instead.")] public LibraryVersion RequestedLibraryVersion { get { return (LibraryVersion)this.RequestedLibraryVersion2.Major; }} diff --git a/tools/NuGet/template-nuget/DynamoVisualProgramming.Core.nuspec b/tools/NuGet/template-nuget/DynamoVisualProgramming.Core.nuspec index 273bceabaeb..a99edebac5a 100644 --- a/tools/NuGet/template-nuget/DynamoVisualProgramming.Core.nuspec +++ b/tools/NuGet/template-nuget/DynamoVisualProgramming.Core.nuspec @@ -10,15 +10,13 @@ content\images\logo.png false - Assemblies required to start a DynamoModel and execute DesignScript code. + Assemblies required to reference core APIs from Dynamo. This package contains the core assemblies for Dynamo. Copyright Autodesk 2023 - - @@ -26,45 +24,23 @@ - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/tools/NuGet/template-nuget/DynamoVisualProgramming.DynamoCoreNodes.nuspec b/tools/NuGet/template-nuget/DynamoVisualProgramming.DynamoCoreNodes.nuspec index 26bcb36c694..1041a024aa8 100644 --- a/tools/NuGet/template-nuget/DynamoVisualProgramming.DynamoCoreNodes.nuspec +++ b/tools/NuGet/template-nuget/DynamoVisualProgramming.DynamoCoreNodes.nuspec @@ -10,13 +10,7 @@ content\images\logo.png false - Reference the core node types for Dynamo. It contains the following files: - 1) Analysis.dll - 2) GeometryColor.dll - 3) DSCoreNodes.dll - 4) CoreNodeModels.dll - 5) Watch3DNodeModels.dll - 6) UnitNodeModels.dll + Reference the core node types for Dynamo. Copyright Autodesk 2023 diff --git a/tools/NuGet/template-nuget/DynamoVisualProgramming.WpfUILibrary.nuspec b/tools/NuGet/template-nuget/DynamoVisualProgramming.WpfUILibrary.nuspec index a75a48c7f1a..f93449ba0fc 100644 --- a/tools/NuGet/template-nuget/DynamoVisualProgramming.WpfUILibrary.nuspec +++ b/tools/NuGet/template-nuget/DynamoVisualProgramming.WpfUILibrary.nuspec @@ -10,9 +10,7 @@ content\images\logo.png false - Build node libraries for Dynamo with custom UI in WPF. It contains the following files: - 1) DynamoCoreWpf.dll - 2) CoreNodeModelsWpf.dll + Build node libraries for Dynamo with custom UI in WPF. This package contains all that is required to get up and running building nodes for the Dynamo Visual Programming language with custom UI in WPF. Copyright Autodesk 2023 diff --git a/tools/NuGet/template-nuget/DynamoVisualProgramming.ZeroTouchLibrary.nuspec b/tools/NuGet/template-nuget/DynamoVisualProgramming.ZeroTouchLibrary.nuspec index 27aec560eac..124657951d8 100644 --- a/tools/NuGet/template-nuget/DynamoVisualProgramming.ZeroTouchLibrary.nuspec +++ b/tools/NuGet/template-nuget/DynamoVisualProgramming.ZeroTouchLibrary.nuspec @@ -24,22 +24,9 @@ - - - - - - - - - - - - - - + - + \ No newline at end of file From 34564e281d3c2a0a8954ef41686e7cbc343a2424 Mon Sep 17 00:00:00 2001 From: pinzart Date: Fri, 22 Dec 2023 13:33:18 -0500 Subject: [PATCH 05/10] Update DynamoVisualProgramming.Tests.nuspec --- .../DynamoVisualProgramming.Tests.nuspec | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/NuGet/template-nuget/DynamoVisualProgramming.Tests.nuspec b/tools/NuGet/template-nuget/DynamoVisualProgramming.Tests.nuspec index 8dd8286d5dd..dc11091c5af 100644 --- a/tools/NuGet/template-nuget/DynamoVisualProgramming.Tests.nuspec +++ b/tools/NuGet/template-nuget/DynamoVisualProgramming.Tests.nuspec @@ -17,7 +17,8 @@ Copyright Autodesk 2023 - + + @@ -28,10 +29,11 @@ - - - - + + + + + From 5aa4bf69d2b3aad887c48e73797510c5d53bdbce Mon Sep 17 00:00:00 2001 From: pinzart Date: Fri, 22 Dec 2023 13:43:18 -0500 Subject: [PATCH 06/10] update --- .../build_props/DynamoVisualProgramming.Core.targets | 8 -------- .../DynamoVisualProgramming.ZeroTouchLibrary.targets | 8 -------- .../NuGet/build_props/TestServices.dll.config | 0 .../template-nuget/DynamoVisualProgramming.Tests.nuspec | 2 +- 4 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 tools/NuGet/build_props/DynamoVisualProgramming.Core.targets delete mode 100644 tools/NuGet/build_props/DynamoVisualProgramming.ZeroTouchLibrary.targets rename test/Libraries/TestServices/App.config => tools/NuGet/build_props/TestServices.dll.config (100%) diff --git a/tools/NuGet/build_props/DynamoVisualProgramming.Core.targets b/tools/NuGet/build_props/DynamoVisualProgramming.Core.targets deleted file mode 100644 index 68c9f4a4f16..00000000000 --- a/tools/NuGet/build_props/DynamoVisualProgramming.Core.targets +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/tools/NuGet/build_props/DynamoVisualProgramming.ZeroTouchLibrary.targets b/tools/NuGet/build_props/DynamoVisualProgramming.ZeroTouchLibrary.targets deleted file mode 100644 index 68c9f4a4f16..00000000000 --- a/tools/NuGet/build_props/DynamoVisualProgramming.ZeroTouchLibrary.targets +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/test/Libraries/TestServices/App.config b/tools/NuGet/build_props/TestServices.dll.config similarity index 100% rename from test/Libraries/TestServices/App.config rename to tools/NuGet/build_props/TestServices.dll.config diff --git a/tools/NuGet/template-nuget/DynamoVisualProgramming.Tests.nuspec b/tools/NuGet/template-nuget/DynamoVisualProgramming.Tests.nuspec index dc11091c5af..a3e2b4ab0ee 100644 --- a/tools/NuGet/template-nuget/DynamoVisualProgramming.Tests.nuspec +++ b/tools/NuGet/template-nuget/DynamoVisualProgramming.Tests.nuspec @@ -33,7 +33,7 @@ - + From 6b5bb4bea52913fcaf131ce7c947d3321679430f Mon Sep 17 00:00:00 2001 From: pinzart Date: Fri, 22 Dec 2023 13:52:08 -0500 Subject: [PATCH 07/10] Update SystemTestBase.cs --- test/Libraries/SystemTestServices/SystemTestBase.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Libraries/SystemTestServices/SystemTestBase.cs b/test/Libraries/SystemTestServices/SystemTestBase.cs index b5a3abd413d..2fedaa6a389 100644 --- a/test/Libraries/SystemTestServices/SystemTestBase.cs +++ b/test/Libraries/SystemTestServices/SystemTestBase.cs @@ -296,7 +296,7 @@ public void AssertPreviewCount(string guid, int count) Assert.AreEqual(count, data.GetElements().ToList().Count); } - protected T GetNode(string guid) where T : class + protected NodeModel GetNode(string guid) { var allNodes = ViewModel.Model.CurrentWorkspace.Nodes; var nodes = allNodes.Where(x => string.CompareOrdinal(x.GUID.ToString(), guid) == 0); @@ -304,7 +304,7 @@ protected T GetNode(string guid) where T : class return null; else if (nodes.Count() > 1) throw new Exception("There are more than one nodes with the same GUID!"); - return nodes.ElementAt(0) as T; + return nodes.ElementAt(0); } public object GetPreviewValue(string guid) From c41b350df763837bcdd964a7381ffcdf3d619df5 Mon Sep 17 00:00:00 2001 From: pinzart90 Date: Tue, 2 Jan 2024 22:44:28 -0500 Subject: [PATCH 08/10] update --- .../SystemTestServices/SystemTestBase.cs | 24 +++++++++++++------ .../TestServices/TestSessionConfiguration.cs | 22 +---------------- .../DynamoVisualProgramming.Tests.nuspec | 5 +--- ...oVisualProgramming.ZeroTouchLibrary.nuspec | 4 +--- 4 files changed, 20 insertions(+), 35 deletions(-) diff --git a/test/Libraries/SystemTestServices/SystemTestBase.cs b/test/Libraries/SystemTestServices/SystemTestBase.cs index 2fedaa6a389..847ab851af4 100644 --- a/test/Libraries/SystemTestServices/SystemTestBase.cs +++ b/test/Libraries/SystemTestServices/SystemTestBase.cs @@ -34,8 +34,8 @@ public abstract class SystemTestBase { protected IPathResolver pathResolver; protected string workingDirectory; - private TestSessionConfiguration testConfig; private Preloader preloader; + private AssemblyResolver assemblyResolver; // Some tests override the static property PathManager.BuiltinPackagesDirectory, so we need a way to reset it after each test. private string originalBuiltinPackagesDirectory; @@ -56,17 +56,21 @@ protected string ExecutingDirectory #endregion - public SystemTestBase() - { - testConfig = new TestSessionConfiguration(); - } - #region public methods [SetUp] public virtual void Setup() { System.Console.WriteLine("Start test: " + TestContext.CurrentContext.Test.Name); + var testConfig = GetTestSessionConfiguration(); + + if (assemblyResolver == null) + { + assemblyResolver = new AssemblyResolver(); + assemblyResolver.Setup(testConfig.DynamoCorePath, new [] { + Path.Combine(testConfig.DynamoCorePath, "nodes") + }); + } SetupCore(); @@ -93,7 +97,7 @@ public virtual void Setup() /// protected virtual TestSessionConfiguration GetTestSessionConfiguration() { - return testConfig; + return new TestSessionConfiguration(); } [TearDown] @@ -119,6 +123,12 @@ public virtual void TearDown() preloader = null; pathResolver = null; + if (assemblyResolver != null) + { + assemblyResolver.TearDown(); + assemblyResolver = null; + } + PathManager.BuiltinPackagesDirectory = originalBuiltinPackagesDirectory; try { diff --git a/test/Libraries/TestServices/TestSessionConfiguration.cs b/test/Libraries/TestServices/TestSessionConfiguration.cs index e877e3dd895..54404deedd8 100644 --- a/test/Libraries/TestServices/TestSessionConfiguration.cs +++ b/test/Libraries/TestServices/TestSessionConfiguration.cs @@ -15,7 +15,6 @@ namespace TestServices /// public class TestSessionConfiguration { - private AssemblyResolver assemblyResolver = new AssemblyResolver(); private const string CONFIG_FILE_NAME = "TestServices.dll.config"; private List supportedLibGVersions = new List { @@ -23,26 +22,7 @@ public class TestSessionConfiguration new Version(229,0,0), }; - private string dynamoCorePath; - - public string DynamoCorePath - { - get => dynamoCorePath; - private set - { - if (!string.IsNullOrEmpty(dynamoCorePath)) - { - // if we have an assembly resolver, try to clean it first. - assemblyResolver?.TearDown(); - } - dynamoCorePath = value; - - // setup the assembly resolver - assemblyResolver?.Setup(dynamoCorePath, new[] { - Path.Combine(dynamoCorePath, "nodes") - }); - } - } + public string DynamoCorePath { get; private set; } [Obsolete("Please use the Version2 Property instead.")] public LibraryVersion RequestedLibraryVersion { get { return (LibraryVersion)this.RequestedLibraryVersion2.Major; }} diff --git a/tools/NuGet/template-nuget/DynamoVisualProgramming.Tests.nuspec b/tools/NuGet/template-nuget/DynamoVisualProgramming.Tests.nuspec index a3e2b4ab0ee..997b16aacc3 100644 --- a/tools/NuGet/template-nuget/DynamoVisualProgramming.Tests.nuspec +++ b/tools/NuGet/template-nuget/DynamoVisualProgramming.Tests.nuspec @@ -9,10 +9,7 @@ https://github.com/DynamoDS/Dynamo content\images\logo.png false - Unit and system test infrastructure for Dynamo. It contains the following files: - 1) DynamoCoreTests.dll - 2) SystemTestServices.dll - 3) TestServices.dll + Unit and system test infrastructure for Dynamo. This package contains all that is required to get up and running creating tests for Dynamo libraries. Copyright Autodesk 2023 diff --git a/tools/NuGet/template-nuget/DynamoVisualProgramming.ZeroTouchLibrary.nuspec b/tools/NuGet/template-nuget/DynamoVisualProgramming.ZeroTouchLibrary.nuspec index 124657951d8..6d58e8088cf 100644 --- a/tools/NuGet/template-nuget/DynamoVisualProgramming.ZeroTouchLibrary.nuspec +++ b/tools/NuGet/template-nuget/DynamoVisualProgramming.ZeroTouchLibrary.nuspec @@ -9,9 +9,7 @@ https://github.com/DynamoDS/Dynamo content\images\logo.png false - Build zero touch node libraries for Dynamo. It contains the following files: - 1) DynamoUnits.dll - 2) ProtoGeometry.dll + Build zero touch node libraries for Dynamo. This package contains all that is required to get up and running building zero touch libraries for the Dynamo Visual Programming language. Copyright Autodesk 2023 From 9b0477a575e30b7d0e98161992b1a041befaf46f Mon Sep 17 00:00:00 2001 From: pinzart90 Date: Thu, 4 Jan 2024 22:41:23 -0500 Subject: [PATCH 09/10] update --- .../Libraries/SystemTestServices/SystemTestBase.cs | 14 +++++++++++++- .../DynamoVisualProgramming.Core.nuspec | 2 ++ .../DynamoVisualProgramming.Tests.nuspec | 10 +++++----- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/test/Libraries/SystemTestServices/SystemTestBase.cs b/test/Libraries/SystemTestServices/SystemTestBase.cs index 847ab851af4..9b0bf11e559 100644 --- a/test/Libraries/SystemTestServices/SystemTestBase.cs +++ b/test/Libraries/SystemTestServices/SystemTestBase.cs @@ -306,8 +306,20 @@ public void AssertPreviewCount(string guid, int count) Assert.AreEqual(count, data.GetElements().ToList().Count); } - protected NodeModel GetNode(string guid) + /// + /// Returns the NodeModel corresponding to the input guid as type T + /// + /// A NodeModel (or derived) type + /// The node Guid + /// + /// + [Obsolete("This method will be removed in a future version of Dynamo")] + public NodeModel GetNode(string guid) where T : class { + if (typeof(T) == typeof(NodeModel) || typeof(T).IsSubclassOf(typeof(NodeModel))) + { + throw new Exception($"{typeof(T)} is not of type NodeModel"); + } var allNodes = ViewModel.Model.CurrentWorkspace.Nodes; var nodes = allNodes.Where(x => string.CompareOrdinal(x.GUID.ToString(), guid) == 0); if (nodes.Count() < 1) diff --git a/tools/NuGet/template-nuget/DynamoVisualProgramming.Core.nuspec b/tools/NuGet/template-nuget/DynamoVisualProgramming.Core.nuspec index a99edebac5a..d4e0c3df2d1 100644 --- a/tools/NuGet/template-nuget/DynamoVisualProgramming.Core.nuspec +++ b/tools/NuGet/template-nuget/DynamoVisualProgramming.Core.nuspec @@ -17,6 +17,8 @@ + + diff --git a/tools/NuGet/template-nuget/DynamoVisualProgramming.Tests.nuspec b/tools/NuGet/template-nuget/DynamoVisualProgramming.Tests.nuspec index 997b16aacc3..5b47ba3dfaf 100644 --- a/tools/NuGet/template-nuget/DynamoVisualProgramming.Tests.nuspec +++ b/tools/NuGet/template-nuget/DynamoVisualProgramming.Tests.nuspec @@ -26,13 +26,13 @@ - - - - - + + + + + From ca27bbdc023c601904bf4541fb1423207f0b73e7 Mon Sep 17 00:00:00 2001 From: pinzart90 <46732933+pinzart90@users.noreply.github.com> Date: Mon, 8 Jan 2024 15:59:01 -0500 Subject: [PATCH 10/10] Update SystemTestBase.cs --- test/Libraries/SystemTestServices/SystemTestBase.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/Libraries/SystemTestServices/SystemTestBase.cs b/test/Libraries/SystemTestServices/SystemTestBase.cs index 9b0bf11e559..24390bbf9e9 100644 --- a/test/Libraries/SystemTestServices/SystemTestBase.cs +++ b/test/Libraries/SystemTestServices/SystemTestBase.cs @@ -307,7 +307,7 @@ public void AssertPreviewCount(string guid, int count) } /// - /// Returns the NodeModel corresponding to the input guid as type T + /// Returns the NodeModel corresponding to the input guid /// /// A NodeModel (or derived) type /// The node Guid @@ -316,7 +316,9 @@ public void AssertPreviewCount(string guid, int count) [Obsolete("This method will be removed in a future version of Dynamo")] public NodeModel GetNode(string guid) where T : class { - if (typeof(T) == typeof(NodeModel) || typeof(T).IsSubclassOf(typeof(NodeModel))) + bool isNodeModel = typeof(T) == typeof(NodeModel); + bool isDerivedFromNodeModel = typeof(T).IsSubclassOf(typeof(NodeModel)); + if ( !isNodeModel && !isDerivedFromNodeModel) { throw new Exception($"{typeof(T)} is not of type NodeModel"); }