Skip to content

Commit

Permalink
Updated version to 6.4 + extended unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarno458 committed Nov 20, 2024
1 parent 9d7214b commit a77828a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
19 changes: 19 additions & 0 deletions Archipelago.MultiClient.Net.Tests/PlayerInfoFixture.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Archipelago.MultiClient.Net.Helpers;
using NUnit.Framework;
using System;

namespace Archipelago.MultiClient.Net.Tests
{
Expand Down Expand Up @@ -50,5 +51,23 @@ public void Equality_should_check_slot_and_team()
Assert.That(PlayerA, Is.Not.EqualTo(PlayerD));
Assert.That((PlayerInfo)null, Is.EqualTo(null));
}

[TestCase(null)]
[TestCase(new int[0])]
public void IsGroup_should_return_false_for_null_or_empty_group(int[] groupMembers)
{
var player = new PlayerInfo { GroupMembers = groupMembers };

Assert.IsFalse(player.IsGroup);
}

[TestCase(new []{1, 2})]
[TestCase(new[]{1})]
public void IsGroup_should_return_true_when_group_members_are_set(int[] groupMembers)
{
var player = new PlayerInfo { GroupMembers = groupMembers };

Assert.IsTrue(player.IsGroup);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/ArchipelagoMW/Archipelago.MultiClient.Net</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<AssemblyVersion>6.3.1.0</AssemblyVersion>
<FileVersion>6.3.1.0</FileVersion>
<Version>6.3.1</Version>
<AssemblyVersion>6.4.0.0</AssemblyVersion>
<FileVersion>6.4.0.0</FileVersion>
<Version>6.4.0</Version>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
<PackageIcon>blue-icon.png</PackageIcon>
Expand Down
4 changes: 2 additions & 2 deletions Archipelago.MultiClient.Net/Helpers/PlayerHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public bool IsSharingGroupWith(int team, int slot) =>
/// <returns>returns the players info's of members from a group slot, or null if this slot is not a group</returns>
public IEnumerable<PlayerInfo> GetGroupMembers(IPlayerHelper playerHelper)
{
if (GroupMembers == null || GroupMembers.Length == 0)
if (!IsGroup)
return null;

return GroupMembers.Select(g => playerHelper.GetPlayerInfo(Team, g));
Expand Down Expand Up @@ -330,7 +330,7 @@ public bool IsRelatedTo(PlayerInfo other) => this == other
public PlayerInfo() {}

/// <summary>
/// Creates and PlayerInfo object, used by json deserialization
/// Creates an PlayerInfo object, used by json deserialization
/// </summary>
/// <param name="team">The team of this player</param>
/// <param name="slot">The slot of this player</param>
Expand Down

0 comments on commit a77828a

Please sign in to comment.