mirror of
https://github.com/logos-storage/logos-storage-nim-cs-dist-tests.git
synced 2026-01-08 00:13:08 +00:00
34 lines
1016 B
C#
34 lines
1016 B
C#
using CodexTests;
|
|
using NUnit.Framework;
|
|
using Utils;
|
|
|
|
namespace CodexReleaseTests.DataTests
|
|
{
|
|
[TestFixture]
|
|
public class ManifestOnlyDownloadTest : CodexDistTest
|
|
{
|
|
[Test]
|
|
public void ManifestOnlyTest()
|
|
{
|
|
var uploader = StartCodex();
|
|
var downloader = StartCodex(s => s.WithBootstrapNode(uploader));
|
|
|
|
var file = GenerateTestFile(2.GB());
|
|
var size = file.GetFilesize().SizeInBytes;
|
|
var cid = uploader.UploadFile(file);
|
|
|
|
var startSpace = downloader.Space();
|
|
var localDataset = downloader.DownloadManifestOnly(cid);
|
|
|
|
Thread.Sleep(1000);
|
|
|
|
var spaceDiff = startSpace.FreeBytes - downloader.Space().FreeBytes;
|
|
|
|
Assert.That(spaceDiff, Is.LessThan(64.KB().SizeInBytes));
|
|
|
|
Assert.That(localDataset.Cid, Is.EqualTo(cid));
|
|
Assert.That(localDataset.Manifest.DatasetSize.SizeInBytes, Is.EqualTo(file.GetFilesize().SizeInBytes));
|
|
}
|
|
}
|
|
}
|