Skip to content

Commit

Permalink
Make the group member APIs public (they weren't) and add tests for them.
Browse files Browse the repository at this point in the history
  • Loading branch information
teo-tsirpanis committed Jan 12, 2024
1 parent 2c43ff5 commit 149d003
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sources/TileDB.CSharp/Group.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public ulong MemberCount()
/// Get member by index.
/// </summary>
/// <param name="index">The member's index.</param>
(string uri, ObjectType object_type, string name) MemberByIndex(ulong index)
public (string Uri, ObjectType ObjectType, string Name) GetMemberByIndex(ulong index)
{
using var ctxHandle = _ctx.Handle.Acquire();
using var handle = _handle.Acquire();
Expand All @@ -299,7 +299,7 @@ public ulong MemberCount()
/// Get member by name.
/// </summary>
/// <param name="name">The member's name.</param>
(string uri, ObjectType object_type) MemberByName(string name)
public (string Uri, ObjectType ObjectType) GetMemberByName(string name)
{
using var ctxHandle = _ctx.Handle.Acquire();
using var handle = _handle.Acquire();
Expand Down
2 changes: 2 additions & 0 deletions tests/TileDB.CSharp.Test/GroupTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ public void TestGroupMember()
//Reopen in read mode
group1.Open(QueryType.Read);
Assert.AreEqual<ulong>(2, group1.MemberCount());
Assert.AreEqual("array1", group1.GetMemberByIndex(0).Name);
Assert.AreEqual(ObjectType.Array, group1.GetMemberByName("array2").ObjectType);
group1.Close();

//Reopen in write mode
Expand Down

0 comments on commit 149d003

Please sign in to comment.