Skip to content

Commit

Permalink
add SwarmUri test
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm360 committed Jul 8, 2024
1 parent ce55039 commit ce89e9d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/BeeNet.Core.UnitTest/Models/SwarmUriTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,18 @@ public void HashAndPathToUri(HashAndPathToUriTestElement test)
}
}

[Fact]
public void ToSwarmAddressConversion()
{
var originalUri = new SwarmUri(null, "Im/path");
var prefixAddress = new SwarmAddress(SwarmHash.Zero, "Im/prefix");

var result = originalUri.ToSwarmAddress(prefixAddress);

Assert.Equal(SwarmHash.Zero, result.Hash);
Assert.Equal("/Im/prefix/Im/path", result.Path);
}

[Theory, MemberData(nameof(TryGetRelativeToUriTests))]
public void TryGetRelativeToUri(TryGetRelativeToUriTestElement test)
{
Expand Down

0 comments on commit ce89e9d

Please sign in to comment.