2023-04-14 12:53:39 +00:00
|
|
|
|
using DistTestCore;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
|
|
|
namespace Tests.BasicTests
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public class OneClientTests : DistTest
|
|
|
|
|
{
|
|
|
|
|
[Test]
|
|
|
|
|
public void OneClientTest()
|
|
|
|
|
{
|
2023-04-25 10:52:11 +00:00
|
|
|
|
var primary = SetupCodexNode();
|
2023-04-14 12:53:39 +00:00
|
|
|
|
|
|
|
|
|
PerformOneClientTest(primary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void RestartTest()
|
|
|
|
|
{
|
2023-04-25 10:52:11 +00:00
|
|
|
|
var primary = SetupCodexNode();
|
2023-04-14 12:53:39 +00:00
|
|
|
|
|
2023-04-25 10:52:11 +00:00
|
|
|
|
var setup = primary.BringOffline();
|
2023-04-14 12:53:39 +00:00
|
|
|
|
|
2023-04-25 10:52:11 +00:00
|
|
|
|
primary = BringOnline(setup)[0];
|
2023-04-14 12:53:39 +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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|