Create backend test environment
MODIFY
MagicalCryptoWallet.Backend/Global.cs
MagicalCryptoWallet.Backend/Global.cs
@@ -35,18 +35,32 @@ namespace MagicalCryptoWallet.Backend
public static Config Config { get; private set; }
- public async static Task InitializeAsync()
+ public async static Task InitializeAsync(Network network = null, string rpcuser = null, string rpcpassword = null, RPCClient rpc = null)
{
_dataDir = null;
+ if (network != null || rpcuser != null || rpcpassword != null)
+ {
+ Config = new Config(network, rpcuser, rpcpassword);
+ }
+ else
+ {
await InitializeConfigAsync();
+ }
+ if(rpc != null)
+ {
+ RpcClient = rpc;
+ }
+ else
+ {
RpcClient = new RPCClient(
credentials: new RPCCredentialString
{
UserPassword = new NetworkCredential(Config.BitcoinRpcUser, Config.BitcoinRpcPassword)
},
network: Config.Network);
+ }
await AssertRpcNodeFullyInitializedAsync();

MODIFY
MagicalCryptoWallet.Tests/CryptoTests.cs
MagicalCryptoWallet.Tests/CryptoTests.cs
@@ -53,7 +53,7 @@ namespace MagicalCryptoWallet.Tests
{
var count = 0;
var errorCount = 0;
- while(count < 10000)
+ while(count < 3)
{
var password = "password";
var plainText = "juan carlos";

Create backend test environment