Mock siad
This commit is contained in:
40
UnitTests/UploadManagerTest.cpp
Normal file
40
UnitTests/UploadManagerTest.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#include "stdafx.h"
|
||||
#include "CppUnitTest.h"
|
||||
#include "SiaApi.h"
|
||||
#include "UploadManager.h"
|
||||
#include "MockSiad.h"
|
||||
#include "SiaDriveConfig.h"
|
||||
|
||||
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
||||
using namespace Sia::Api;
|
||||
|
||||
namespace UnitTests
|
||||
{
|
||||
TEST_CLASS(UnitTests)
|
||||
{
|
||||
private:
|
||||
const SiaHostConfig hostConfig = { L"localhost", 19980, L"1.1.0" };
|
||||
std::unique_ptr<CMockSiad> siad;
|
||||
|
||||
public:
|
||||
TEST_METHOD_INITIALIZE(Initialize)
|
||||
{
|
||||
siad.reset(new CMockSiad(hostConfig));
|
||||
}
|
||||
|
||||
TEST_METHOD_CLEANUP(Cleanup)
|
||||
{
|
||||
siad->Stop();
|
||||
}
|
||||
|
||||
TEST_METHOD(TestMethod1)
|
||||
{
|
||||
siad->Start(SiadTestType::UploadFile);
|
||||
|
||||
CSiaDriveConfig driveConfig;
|
||||
CSiaCurl siaCurl(hostConfig);
|
||||
|
||||
CUploadManager uploadManager(siaCurl, &driveConfig);
|
||||
}
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user