Skip to content

Commit da8cfff

Browse files
committed
Fix test for empty torrent ToBDictionary
+semver: skip
1 parent 746b835 commit da8cfff

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

BencodeNET.Tests/Torrents/TorrentTests.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -553,12 +553,18 @@ public void ToBDictionary_ExtraFields_OverwritesExistingData(string comment, BSt
553553
}
554554

555555
[Fact]
556-
public void ToBDictionary_EqualsEmptyBDictionaryForEmptyTorrent()
556+
public void ToBDictionary_EmptyTorrent_ContainsOnlyInfoPrivateField()
557557
{
558558
var torrent = new Torrent();
559559
var result = torrent.ToBDictionary();
560-
result.Should().HaveCount(0);
561-
result.Should().BeEquivalentTo(new BDictionary());
560+
result.Should().HaveCount(1);
561+
result.Should().BeEquivalentTo(new BDictionary
562+
{
563+
[TorrentFields.Info] = new BDictionary
564+
{
565+
[TorrentInfoFields.Private] = (BNumber)0,
566+
},
567+
});
562568
}
563569

564570
[Theory]

0 commit comments

Comments
 (0)