From d643632306635426f56c7c87bde7a02b459f42de Mon Sep 17 00:00:00 2001 From: spsarras Date: Fri, 29 Nov 2024 12:00:02 +0000 Subject: [PATCH] feat: added empty list test --- .../Helpers/Assemble/AssembleModelListsTests.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/GsaGHTests/Helpers/Assemble/AssembleModelListsTests.cs b/GsaGHTests/Helpers/Assemble/AssembleModelListsTests.cs index 16538aa22..de3a44eb1 100644 --- a/GsaGHTests/Helpers/Assemble/AssembleModelListsTests.cs +++ b/GsaGHTests/Helpers/Assemble/AssembleModelListsTests.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System.Collections.Concurrent; +using System.Collections.Generic; using System.Linq; using GsaAPI; @@ -27,6 +28,17 @@ public void ListShouldReturnDefinitionWhenIdIsSet() { Assert.Equal(ExpectedDefinition, gsaList.Definition); } + [Fact] + public void ListWithEmptyNodesShouldReturnDefinitionWhenIdIsSet() { + const int ExpectedId = 2; + GsaList gsaList = GsaList(ExpectedId); + gsaList._nodes = new ConcurrentBag(); + + Assert.Equal(ExpectedId, gsaList.Id); + Assert.Equal(ExpectedName, gsaList.Name); + Assert.Equal(ExpectedDefinition, gsaList.Definition); + } + [Fact] public void ListShouldReturnDefinitionWhenIdIsNotSet() { GsaList gsaList = GsaList(null);