Fixes #202 This PR fixes code style for the project files. The Problem Different files in the project use different code style. That is not consistent and leads to harder maintenance of the project. Description of the changes: Have investigated and determined the most used code style across the given codebase Have configured IDE and applied code style to all project files. Have crafted clang-formatter config. see https://clang.llvm.org/docs/ClangFormat.html https://clang.llvm.org/docs/ClangFormatStyleOptions.html Some cases were fixed manually How changes were validated: manual/ad-hoc testing, automated testing All tests pass as before because these are only code style changes. Additional Please review, and let me know if I have any mistake in the code style. In case of any mistake, I will change the configuration and re-apply it to the project.
91 lines
3.3 KiB
C++
91 lines
3.3 KiB
C++
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// Licensed under the MIT License.
|
|
|
|
#pragma once
|
|
|
|
#include "CalcViewModel/DataLoaders/ICurrencyHttpClient.h"
|
|
|
|
namespace CalculatorApp
|
|
{
|
|
namespace DataLoaders
|
|
{
|
|
class CurrencyHttpClient : public ICurrencyHttpClient
|
|
{
|
|
public:
|
|
CurrencyHttpClient();
|
|
|
|
static Platform::String ^ GetRawStaticDataResponse();
|
|
static Platform::String ^ GetRawAllRatiosDataResponse();
|
|
|
|
// ICurrencyHttpClient
|
|
void SetSourceCurrencyCode(Platform::String ^ sourceCurrencyCode) override
|
|
{
|
|
}
|
|
void SetResponseLanguage(Platform::String ^ responseLanguage) override
|
|
{
|
|
}
|
|
|
|
virtual Windows::Foundation::IAsyncOperationWithProgress<Platform::String ^, Windows::Web::Http::HttpProgress> ^ GetCurrencyMetadata() override;
|
|
virtual Windows::Foundation::IAsyncOperationWithProgress<Platform::String ^, Windows::Web::Http::HttpProgress> ^ GetCurrencyRatios() override;
|
|
// ICurrencyHttpClient
|
|
};
|
|
|
|
public
|
|
ref class MockAsyncOperationWithProgress sealed
|
|
: public Windows::Foundation::IAsyncOperationWithProgress<Platform::String ^, Windows::Web::Http::HttpProgress>
|
|
{
|
|
public:
|
|
MockAsyncOperationWithProgress(Platform::String ^ result);
|
|
|
|
// IAsyncInfo
|
|
virtual property Windows::Foundation::HResult ErrorCode
|
|
{
|
|
Windows::Foundation::HResult get();
|
|
}
|
|
|
|
virtual property unsigned int Id
|
|
{
|
|
unsigned int get()
|
|
{
|
|
return 128u;
|
|
}
|
|
}
|
|
|
|
virtual property Windows::Foundation::AsyncStatus Status
|
|
{
|
|
Windows::Foundation::AsyncStatus get()
|
|
{
|
|
return Windows::Foundation::AsyncStatus::Completed;
|
|
}
|
|
}
|
|
|
|
virtual void Cancel()
|
|
{
|
|
}
|
|
virtual void Close()
|
|
{
|
|
}
|
|
// IAsyncInfo
|
|
|
|
// IAsyncOperationWithProgress
|
|
virtual property Windows::Foundation::AsyncOperationProgressHandler<Platform::String^, Windows::Web::Http::HttpProgress>^ Progress
|
|
{
|
|
Windows::Foundation::AsyncOperationProgressHandler<Platform::String^, Windows::Web::Http::HttpProgress>^ get() { return nullptr; }
|
|
void set(Windows::Foundation::AsyncOperationProgressHandler<Platform::String^, Windows::Web::Http::HttpProgress>^ handler) {}
|
|
}
|
|
|
|
virtual property Windows::Foundation::AsyncOperationWithProgressCompletedHandler<Platform::String^, Windows::Web::Http::HttpProgress>^ Completed
|
|
{
|
|
Windows::Foundation::AsyncOperationWithProgressCompletedHandler<Platform::String^, Windows::Web::Http::HttpProgress>^ get() { return nullptr; }
|
|
void set(Windows::Foundation::AsyncOperationWithProgressCompletedHandler<Platform::String^, Windows::Web::Http::HttpProgress>^ handler) {}
|
|
}
|
|
|
|
virtual Platform::String^ GetResults() { return m_result; }
|
|
// IAsyncOperationWithProgress
|
|
|
|
private:
|
|
Platform::String^ m_result;
|
|
};
|
|
}
|
|
}
|