The project implements a .Net Core 3.1 C# library which interacts with the Bitcoin Price Index api.
The following tools and frameworks have been used to perform the TDD developement:
- xUnit - a unit testing framework, used to implement unit tests
- Moq - a mocking library, used to create mocks for external dependencies
- GitHub Actions - used to provide CICD features for automated building and testing
- Coveralls - used to provide unit test code coverage reports
This project builds a .Net Core 3.1 library which contains the following 2 public methods:
public async Task<double> GetExchangeRate(Currency currency)
returns in realtime the current Bitcoin exchange rate for the given currency (USD, GBP, or EUR)
public async Task<double> ConvertBitcoins(Currency currency, double coins)
returns the dollar value for the given currency (USD, GBP, or EUR), and the number of Bitcoins
To build the Bitcoin Converter Library perform the following commands:
dotnet build
This project also contains a sample client console based application - which imports the Bitcoin Converter library. To build and run the client for windows and Linux x64 distros, perform the following commands:
#build/package executable file
#Build for linux
cd BitcoinConverter.Client
dotnet publish --runtime linux-x64 --configuration Release /p:TargetFramework=netcoreapp3.1 /p:PublishSingleFile=true /p:PublishTrimmed=true
#Build for windows
cd BitcoinConverter.Client
dotnet publish -r win10-x64 --configuration Release /p:TargetFramework=netcoreapp3.1 /p:PublishSingleFile=true /p:PublishTrimmed=true -o ./executable
#run executable:
./BitcoinConverter.Client
This project uses GitHub Actions to perform automated builds, testing, packaging, and releases.
This project forwards its unit testing code coverage reports to coveralls.io for report viewing and analysis