feyris-tan 37a070b665
All checks were successful
🚀 Pack skyscraper8 / make-zip (push) Successful in 6m10s
Moved from MSTest to NUnit
2026-06-15 22:53:52 +02:00

32 lines
973 B
C#

using skyscraper5.Skyscraper;
using skyscraper8.Skyscraper.Scraper.Storage.Tar;
namespace skyscraper8.Tests.NUnit.Tests.IntegrationTests;
[TestFixture]
public class SkyscraperIntegrationTests : SkyscrapersTestingFramework
{
[Test]
public void CreateTarArchive()
{
string filename = String.Format("{0}.tar", DateTime.Now.ToUnixTime());
FileInfo fi = new FileInfo(filename);
FileStream fileStream = fi.Open(FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Read);
fi.Refresh();
Assert.IsTrue(fi.Exists);
Random rng = new Random();
TarArchive tar = new TarArchive(fileStream);
for (int i = 0; i < 42; i++)
{
filename = String.Format("{0}.bin", i);
int randomSize = rng.Next(4096);
byte[] buffer = new byte[randomSize];
rng.NextBytes(buffer);
tar.WriteEntry(filename, buffer);
}
}
}