2023-09-12 13:43:30 +00:00
|
|
|
|
using CodexPlugin;
|
|
|
|
|
using DistTestCore;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using Utils;
|
|
|
|
|
|
2023-10-09 14:59:52 +00:00
|
|
|
|
namespace CodexTests.BasicTests
|
2023-09-12 13:43:30 +00:00
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public class OneClientTests : DistTest
|
|
|
|
|
{
|
|
|
|
|
[Test]
|
|
|
|
|
public void OneClientTest()
|
|
|
|
|
{
|
2023-09-20 10:02:32 +00:00
|
|
|
|
var primary = Ci.StartCodexNode();
|
2023-09-12 13:43:30 +00:00
|
|
|
|
|
|
|
|
|
PerformOneClientTest(primary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void RestartTest()
|
|
|
|
|
{
|
2023-09-20 10:02:32 +00:00
|
|
|
|
var primary = Ci.StartCodexNode();
|
2023-09-12 13:43:30 +00:00
|
|
|
|
|
2023-09-19 09:51:59 +00:00
|
|
|
|
primary.Stop();
|
2023-09-12 13:43:30 +00:00
|
|
|
|
|
2023-09-20 10:02:32 +00:00
|
|
|
|
primary = Ci.StartCodexNode();
|
2023-09-12 13:43:30 +00:00
|
|
|
|
|
|
|
|
|
PerformOneClientTest(primary);
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-19 09:51:59 +00:00
|
|
|
|
private void PerformOneClientTest(ICodexNode primary)
|
2023-09-12 13:43:30 +00:00
|
|
|
|
{
|
|
|
|
|
var testFile = GenerateTestFile(1.MB());
|
|
|
|
|
|
|
|
|
|
var contentId = primary.UploadFile(testFile);
|
|
|
|
|
|
|
|
|
|
var downloadedFile = primary.DownloadContent(contentId);
|
|
|
|
|
|
|
|
|
|
testFile.AssertIsEqual(downloadedFile);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|