diff --git a/GsaGHTests/Helpers/Assemble/AssembleModelLists.cs b/GsaGHTests/Helpers/Assemble/AssembleModelListsTests.cs similarity index 91% rename from GsaGHTests/Helpers/Assemble/AssembleModelLists.cs rename to GsaGHTests/Helpers/Assemble/AssembleModelListsTests.cs index 69590f47e..83212d523 100644 --- a/GsaGHTests/Helpers/Assemble/AssembleModelLists.cs +++ b/GsaGHTests/Helpers/Assemble/AssembleModelListsTests.cs @@ -5,7 +5,7 @@ namespace GsaGHTests.Helpers.Assemble { [Collection("GrasshopperFixture collection")] - public class AssembleModelLists { + public class AssembleModelListsTests { private const int DefaultId = 1; private const string ExpectedName = "create list test"; private const string ExpectedDefinition = "1 2 3"; @@ -22,7 +22,7 @@ public void ListShouldReturnDefinitionWhenIdIsSet() { [Fact] public void ListShouldReturnDefinitionWhenIdIsNotSet() { - GsaList gsaList = GsaList(DefaultId); + GsaList gsaList = GsaList(null); Assert.Equal(DefaultId, gsaList.Id); Assert.Equal(ExpectedName, gsaList.Name); @@ -39,10 +39,7 @@ private static GsaListGoo CreateListComponent(int? id) { var createListComponent = new CreateList(); createListComponent.CreateAttributes(); - if (id != DefaultId) { - ComponentTestHelper.SetInput(createListComponent, id, 0); - } - + ComponentTestHelper.SetInput(createListComponent, id, 0); ComponentTestHelper.SetInput(createListComponent, ExpectedName, 1); ComponentTestHelper.SetInput(createListComponent, ExpectedDefinition, 2); diff --git a/GsaGHTests/TestHelpers/ComponentTestHelper.cs b/GsaGHTests/TestHelpers/ComponentTestHelper.cs index e188409aa..8115f4bd1 100644 --- a/GsaGHTests/TestHelpers/ComponentTestHelper.cs +++ b/GsaGHTests/TestHelpers/ComponentTestHelper.cs @@ -151,7 +151,7 @@ public static void SetInput(GH_Component component, object obj, string name) { private static Param_GenericObject GetGenericParameterFor(object obj) { var input = new Param_GenericObject(); input.CreateAttributes(); - if (typeof(IQuantity).IsAssignableFrom(obj.GetType())) { + if (typeof(IQuantity).IsAssignableFrom(obj?.GetType())) { input.PersistentData.Append(new GH_UnitNumber((IQuantity)obj)); } else { input.PersistentData.Append(new GH_ObjectWrapper(obj));