Start writing tests
MODIFY
.gitignore
.gitignore
@@ -260,3 +260,4 @@ paket-files/
__pycache__/
*.pyc
/MagicalCryptoWallet.Backend/Logs.txt
+/MagicalCryptoWallet.Backend/Log.txt

MODIFY
MagicalCryptoWallet.Backend/Global.cs
MagicalCryptoWallet.Backend/Global.cs
@@ -19,7 +19,7 @@ namespace MagicalCryptoWallet.Backend
{
if (!string.IsNullOrWhiteSpace(_dataDir)) return _dataDir;
- _dataDir = EnvironmentHelpers.GetDataDir("MagicalCryptoWalletBackend");
+ _dataDir = EnvironmentHelpers.GetDataDir(Path.Combine("MagicalCryptoWallet","Backend"));
return _dataDir;
}
@@ -79,10 +79,10 @@ namespace MagicalCryptoWallet.Backend
if (blocks != headers)
{
- throw new NotSupportedException("Bitcoin Core is not fully syncronized.");
+ throw new NotSupportedException("Bitcoin Core is not fully synchronized.");
}
- Logger.LogInfo<RPCClient>("Bitcoin Core is fully syncronized.");
+ Logger.LogInfo<RPCClient>("Bitcoin Core is fully synchronized.");
var estimateSmartFeeResponse = await RpcClient.TryEstimateSmartFeeAsync(2, EstimateSmartFeeMode.Conservative);
if (estimateSmartFeeResponse == null) throw new NotSupportedException($"Bitcoin Core cannot estimate network fees yet.");

MODIFY
MagicalCryptoWallet.Backend/Program.cs
MagicalCryptoWallet.Backend/Program.cs
@@ -18,9 +18,9 @@ namespace MagicalCryptoWallet.Backend
{
try
{
- Logger.SetMinimumLevel(LogLevel.Debug);
+ Logger.SetMinimumLevel(LogLevel.Info);
Logger.SetModes(LogMode.Debug, LogMode.Console, LogMode.File);
- Logger.SetFilePath("Logs.txt");
+ Logger.SetFilePath(Path.Combine(Global.DataDir,"Logs.txt"));
await Global.InitializeAsync();

MODIFY
MagicalCryptoWallet.Tests/KeyManagementTests.cs
MagicalCryptoWallet.Tests/KeyManagementTests.cs
@@ -98,7 +98,7 @@ namespace MagicalCryptoWallet.Tests
string password = "password";
var manager = KeyManager.CreateNew(out Mnemonic mnemonic, password);
- var filePath = "WalletDir/Wallet.json";
+ var filePath = Path.Combine(SharedFixture.DataDir, nameof(CanSerialize), "Wallet.json");
DeleteFileAndDirectoryIfExists(filePath);
Assert.Throws<FileNotFoundException>(() => KeyManager.FromFile(filePath));

Start writing tests