Skip to content

Commit

Permalink
feat: added empty list test
Browse files Browse the repository at this point in the history
  • Loading branch information
psarras committed Nov 29, 2024
1 parent e3dba5e commit d643632
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion GsaGHTests/Helpers/Assemble/AssembleModelListsTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;

using GsaAPI;
Expand Down Expand Up @@ -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<GsaNodeGoo>();

Assert.Equal(ExpectedId, gsaList.Id);
Assert.Equal(ExpectedName, gsaList.Name);
Assert.Equal(ExpectedDefinition, gsaList.Definition);
}

[Fact]
public void ListShouldReturnDefinitionWhenIdIsNotSet() {
GsaList gsaList = GsaList(null);
Expand Down

0 comments on commit d643632

Please sign in to comment.