Using theory to pass in network
MODIFY
WalletWasabi.Tests/LiveServerTests.cs
WalletWasabi.Tests/LiveServerTests.cs
@@ -11,38 +11,38 @@ using WalletWasabi.TorSocks5;
using WalletWasabi.WebClients.ChaumianCoinJoin;
using Xunit;
-namespace WalletWasabi.Tests {
- public class LiveServerTests : IClassFixture<SharedFixture> {
- public Dictionary<Network, Uri> NetworkUriMappings;
- public LiveServerTests()
+namespace WalletWasabi.Tests
{
- NetworkUriMappings = new Dictionary<Network, Uri>
+ public class LiveServerTests : IClassFixture<SharedFixture>
{
- { Network.Main, new Uri("http://wtgjmaol3io5ijii.onion") },
- { Network.TestNet, new Uri("http://4jsmnfcsmbrlm7l7.onion") }
- };
- }
- [Fact]
- public async Task GetFeesAsync()
+ private readonly Dictionary<NetworkType, Uri> _networkUriMappings = new Dictionary<NetworkType, Uri>
{
- foreach (var server in NetworkUriMappings)
+ { NetworkType.Mainnet, new Uri("http://wtgjmaol3io5ijii.onion") },
+ { NetworkType.Testnet, new Uri("http://4jsmnfcsmbrlm7l7.onion") }
+ };
+
+ [Theory]
+ [InlineData(NetworkType.Mainnet)]
+ [InlineData(NetworkType.Testnet)]
+ public async Task GetFeesAsync(NetworkType network)
{
try
{
- Logger.LogInfo<LiveServerTests>($"Init client for {server.Key}");
- using (var client = new WasabiClient(server.Value, null))
+ Logger.LogInfo<LiveServerTests>($"Init client for {network}");
+
+ using (var client = new WasabiClient(_networkUriMappings[network], null))
{
var feeEstimationPairs = await client.GetFeesAsync(1000);
+
Assert.NotNull(feeEstimationPairs);
Assert.NotEmpty(feeEstimationPairs);
- Logger.LogInfo<LiveServerTests>($"GetFeesAsync successful for {server.Key}");
+
+ Logger.LogInfo<LiveServerTests>($"GetFeesAsync successful for {network}");
}
}
catch (Exception ex)
{
-
- throw ex;
- }
+ Logger.LogDebug<LiveServerTests>(ex);
}
}
}

Using theory to pass in network