Merge pull request #720 from Cucumberrbob/tests/use-theory-data
Use `TheoryData<>` instead of `Object[]` for theory data
This commit is contained in:
commit
e9becefb1c
2 changed files with 18 additions and 7 deletions
|
|
@ -294,9 +294,17 @@ public class AllDebridTorrentClientTest
|
||||||
Assert.Contains(secondResult, t => t.Id == Magnet2Finished.Id.ToString());
|
Assert.Contains(secondResult, t => t.Id == Magnet2Finished.Id.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IEnumerable<Object[]> DownloadingMagnetsWithProgress()
|
public static TheoryData<Magnet, Int64> DownloadingMagnetsWithProgress()
|
||||||
{
|
{
|
||||||
return [[Magnet1HalfDownloaded, 50], [Magnet2QuarterDownloaded, 25]];
|
return new()
|
||||||
|
{
|
||||||
|
{
|
||||||
|
Magnet1HalfDownloaded, 50
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Magnet2QuarterDownloaded, 25
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ class Mocks
|
||||||
|
|
||||||
public class TorrentsTest
|
public class TorrentsTest
|
||||||
{
|
{
|
||||||
public static IEnumerable<Object[]> TorrentAndDownload()
|
public static TheoryData<Torrent, List<Download>> TorrentAndDownload()
|
||||||
{
|
{
|
||||||
var torrent = new Torrent()
|
var torrent = new Torrent()
|
||||||
{
|
{
|
||||||
|
|
@ -58,10 +58,13 @@ public class TorrentsTest
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
yield return
|
return new ()
|
||||||
[
|
{
|
||||||
torrent, downloads
|
{
|
||||||
];
|
torrent,
|
||||||
|
downloads
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue