mirror of
https://github.com/logos-storage/logos-storage-nim-cs-dist-tests.git
synced 2026-01-05 06:53:07 +00:00
34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
using CodexTests;
|
|
using NUnit.Framework;
|
|
using Utils;
|
|
|
|
namespace CodexReleaseTests.DataTests
|
|
{
|
|
[TestFixture]
|
|
public class StreamlessDownloadTest : CodexDistTest
|
|
{
|
|
[Test]
|
|
public void StreamlessTest()
|
|
{
|
|
var uploader = StartCodex();
|
|
var downloader = StartCodex(s => s.WithBootstrapNode(uploader));
|
|
|
|
var size = 10.MB();
|
|
var file = GenerateTestFile(size);
|
|
var cid = uploader.UploadFile(file);
|
|
|
|
var startSpace = downloader.Space();
|
|
var start = DateTime.UtcNow;
|
|
var localDataset = downloader.DownloadStreamlessWait(cid, size);
|
|
|
|
Assert.That(localDataset.Cid, Is.EqualTo(cid));
|
|
Assert.That(localDataset.Manifest.OriginalBytes.SizeInBytes, Is.EqualTo(file.GetFilesize().SizeInBytes));
|
|
|
|
// Stop the uploader node and verify that the downloader has the data.
|
|
uploader.Stop(waitTillStopped: true);
|
|
var downloaded = downloader.DownloadContent(cid);
|
|
file.AssertIsEqual(downloaded);
|
|
}
|
|
}
|
|
}
|