Maybe it's better like this.
MODIFY
WalletWasabi.Tests/Common.cs
WalletWasabi.Tests/Common.cs
@@ -34,9 +34,7 @@ namespace WalletWasabi.Tests
public static string DataDir => EnvironmentHelpers.GetDataDir(Path.Combine("WalletWasabi", "Tests"));
- public static SmartTransaction RandomSmartTransaction
- {
- get
+ public static SmartTransaction GetRandomSmartTransaction()
{
var tx = Transaction.Create(Network.Main);
tx.Outputs.Add(Money.Coins(1), new Key());
@@ -45,4 +43,3 @@ namespace WalletWasabi.Tests
}
}
}
-}

MODIFY
WalletWasabi.Tests/UnitTests/Transactions/AllTransactionStoreTests.cs
WalletWasabi.Tests/UnitTests/Transactions/AllTransactionStoreTests.cs
@@ -88,7 +88,7 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
Assert.Empty(txStore.ConfirmedStore.GetTransactions());
Assert.Empty(txStore.ConfirmedStore.GetTransactionHashes());
- uint256 txHash = Common.RandomSmartTransaction.GetHash();
+ uint256 txHash = Common.GetRandomSmartTransaction().GetHash();
Assert.False(txStore.Contains(txHash));
Assert.True(txStore.IsEmpty());
Assert.False(txStore.TryGetTransaction(txHash, out _));
@@ -147,7 +147,7 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
Assert.Equal(3, txStore.ConfirmedStore.GetTransactionHashes().Count());
Assert.False(txStore.IsEmpty());
- uint256 doesntContainTxHash = Common.RandomSmartTransaction.GetHash();
+ uint256 doesntContainTxHash = Common.GetRandomSmartTransaction().GetHash();
Assert.False(txStore.Contains(doesntContainTxHash));
Assert.False(txStore.TryGetTransaction(doesntContainTxHash, out _));
@@ -350,7 +350,7 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
var txStore = new AllTransactionStore(PrepareWorkDir(), network);
await txStore.InitializeAsync(ensureBackwardsCompatibility: false);
- var tx = Common.RandomSmartTransaction;
+ var tx = Common.GetRandomSmartTransaction();
Assert.False(txStore.TryUpdate(tx));
// Assert TryUpdate didn't modify anything.
@@ -364,7 +364,7 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
Assert.Empty(txStore.ConfirmedStore.GetTransactions());
Assert.Empty(txStore.ConfirmedStore.GetTransactionHashes());
- uint256 txHash = Common.RandomSmartTransaction.GetHash();
+ uint256 txHash = Common.GetRandomSmartTransaction().GetHash();
Assert.False(txStore.Contains(txHash));
Assert.True(txStore.IsEmpty());
Assert.False(txStore.TryGetTransaction(txHash, out _));

MODIFY
WalletWasabi.Tests/UnitTests/Transactions/OperationMergerTests.cs
WalletWasabi.Tests/UnitTests/Transactions/OperationMergerTests.cs
@@ -9,7 +9,7 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
[Fact]
public void CanMergeSingleOperations()
{
- var tx = Common.RandomSmartTransaction;
+ var tx = Common.GetRandomSmartTransaction();
var append = new Append(tx);
var unmergedAppendOperations = new[] { append };
@@ -39,14 +39,14 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
[Fact]
public void CanMergeComplexOperations()
{
- var tx1 = Common.RandomSmartTransaction;
- var tx2 = Common.RandomSmartTransaction;
- var tx3 = Common.RandomSmartTransaction;
- var tx4 = Common.RandomSmartTransaction;
- var tx5 = Common.RandomSmartTransaction;
- var tx6 = Common.RandomSmartTransaction;
- var tx7 = Common.RandomSmartTransaction;
- var tx8 = Common.RandomSmartTransaction;
+ var tx1 = Common.GetRandomSmartTransaction();
+ var tx2 = Common.GetRandomSmartTransaction();
+ var tx3 = Common.GetRandomSmartTransaction();
+ var tx4 = Common.GetRandomSmartTransaction();
+ var tx5 = Common.GetRandomSmartTransaction();
+ var tx6 = Common.GetRandomSmartTransaction();
+ var tx7 = Common.GetRandomSmartTransaction();
+ var tx8 = Common.GetRandomSmartTransaction();
var a1 = new Append(tx1, tx2);
var a2 = new Append(tx3, tx4, tx5);

MODIFY
WalletWasabi.Tests/UnitTests/Transactions/TransactionStoreTests.cs
WalletWasabi.Tests/UnitTests/Transactions/TransactionStoreTests.cs
@@ -34,7 +34,7 @@ namespace WalletWasabi.Tests.UnitTests.Transactions
Assert.True(txStore.IsEmpty());
- var stx = Common.RandomSmartTransaction;
+ var stx = Common.GetRandomSmartTransaction();
var operation = txStore.TryAddOrUpdate(stx);
Assert.True(operation.isAdded);
Assert.False(operation.isUpdated);

Maybe it's better like this.