34 lines
1.0 KiB
C#
Raw Normal View History

using LogosStorageClient;
using LogosStorageTests;
2024-11-21 10:46:11 +01:00
using NUnit.Framework;
namespace LogosStorageReleaseTests.DataTests
2024-11-21 10:46:11 +01:00
{
[TestFixture]
public class UnknownCidTest : LogosStorageDistTest
2024-11-21 10:46:11 +01:00
{
[Test]
public void DownloadingUnknownCidDoesNotCauseCrash()
{
var node = StartLogosStorage(s => s.WithLogFormat(LogosStorageLogFormat.Json));
2024-11-21 10:46:11 +01:00
var unknownCid = new ContentId("zDvZRwzkzHsok3Z8yMoiXE9EDBFwgr8WygB8s4ddcLzzSwwXAxLZ");
var localFiles = node.LocalFiles().Content;
CollectionAssert.DoesNotContain(localFiles.Select(f => f.Cid), unknownCid);
try
{
2025-07-09 16:00:40 +02:00
node.DownloadContent(unknownCid, TimeSpan.FromMinutes(2.0));
2024-11-21 10:46:11 +01:00
}
catch (Exception ex)
{
var expectedMessage = "Content specified by the CID is not found";
if (!ex.Message.Contains(expectedMessage)) throw;
2024-11-21 10:46:11 +01:00
}
WaitAndCheckNodesStaysAlive(TimeSpan.FromMinutes(2), node);
}
}
}