Skip to content

Commit

Permalink
full coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
bassmang committed Jan 30, 2025
1 parent b908d1d commit b3aab31
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions dotnet/test/Microsoft.AutoGen.Core.Tests/AgentIdTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,30 @@ public void AgentIdShouldGenerateCorrectHashCodeTest()
agentId1.GetHashCode().Should().Be(agentId2.GetHashCode());
agentId1.GetHashCode().Should().NotBe(agentId3.GetHashCode());
}

[Fact]
public void AgentIdShouldConvertExplicitlyFromStringTest()
{
var agentId = (AgentId)"ConvertedType/ConvertedKey";

agentId.Type.Should().Be("ConvertedType");
agentId.Key.Should().Be("ConvertedKey");
}

[Fact]
public void AgentIdShouldReturnCorrectToStringTest()
{
var agentId = new AgentId("ToStringType", "ToStringKey");

agentId.ToString().Should().Be("ToStringType/ToStringKey");
}

[Fact]
public void AgentIdShouldCompareInequalityCorrectlyTest()
{
var agentId1 = new AgentId("Type1", "Key1");
var agentId2 = new AgentId("Type2", "Key2");

(agentId1 != agentId2).Should().BeTrue();
}
}

0 comments on commit b3aab31

Please sign in to comment.