2023-09-12 13:43:30 +00:00
|
|
|
|
using CodexPlugin;
|
|
|
|
|
using DistTestCore;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using Utils;
|
|
|
|
|
|
|
|
|
|
namespace Tests.BasicTests
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public class OneClientTests : DistTest
|
|
|
|
|
{
|
|
|
|
|
[Test]
|
|
|
|
|
public void OneClientTest()
|
|
|
|
|
{
|
2023-09-13 06:55:04 +00:00
|
|
|
|
var primary = Ci.SetupCodexNode();
|
2023-09-12 13:43:30 +00:00
|
|
|
|
|
|
|
|
|
PerformOneClientTest(primary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void RestartTest()
|
|
|
|
|
{
|
2023-09-13 06:55:04 +00:00
|
|
|
|
var primary = Ci.SetupCodexNode();
|
2023-09-12 13:43:30 +00:00
|
|
|
|
|
2023-09-13 10:09:44 +00:00
|
|
|
|
primary.BringOffline();
|
2023-09-12 13:43:30 +00:00
|
|
|
|
|
2023-09-13 10:09:44 +00:00
|
|
|
|
primary = Ci.SetupCodexNode();
|
2023-09-12 13:43:30 +00:00
|
|
|
|
|
|
|
|
|
PerformOneClientTest(primary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void PerformOneClientTest(IOnlineCodexNode primary)
|
|
|
|
|
{
|
|
|
|
|
var testFile = GenerateTestFile(1.MB());
|
|
|
|
|
|
|
|
|
|
var contentId = primary.UploadFile(testFile);
|
|
|
|
|
|
|
|
|
|
var downloadedFile = primary.DownloadContent(contentId);
|
|
|
|
|
|
|
|
|
|
testFile.AssertIsEqual(downloadedFile);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|