public async Task AddNewTorrentTask() { var mockFactory = new Mock <IHttpClientFactory>(); mockFactory.Setup(c => c.CreateClient()).Returns(new HttpClient()); var downloader = new Aria2Downloader(configuration, mockFactory.Object, new NullLogger <Aria2Downloader>()); var torrentBytes = File.ReadAllBytes("valid.torrent"); await downloader.AddNewTorrentTask(torrentBytes); }
public async Task TryConnect() { var mockFactory = new Mock <IHttpClientFactory>(); mockFactory.Setup(c => c.CreateClient()).Returns(new HttpClient()); var downloader = new Aria2Downloader(configuration, mockFactory.Object, new NullLogger <Aria2Downloader>()); var result = await downloader.TryConnect(); Assert.IsTrue(result); }