Use `Assert.{Equal|NotEqual}` instead of `Assert.{True|False}( ... == ...)`.
MODIFY
WalletWasabi.Tests/IntegrationTests/LiveServerTests.cs
WalletWasabi.Tests/IntegrationTests/LiveServerTests.cs
@@ -58,7 +58,7 @@ public class LiveServerTests : IAsyncLifetime
FiltersResponse? filtersResponse = await client.GetFiltersAsync(filterModel.Header.BlockHash, 2);
Assert.NotNull(filtersResponse);
- Assert.True(filtersResponse!.Filters.Count() == 2);
+ Assert.Equal(2, filtersResponse!.Filters.Count());
}
[Theory]

MODIFY
WalletWasabi.Tests/RegressionTests/BackendTests.cs
WalletWasabi.Tests/RegressionTests/BackendTests.cs
@@ -46,7 +46,7 @@ public class BackendTests
public async Task GetExchangeRatesAsync()
{
using var response = await BackendApiHttpClient.SendAsync(HttpMethod.Get, "btc/offchain/exchange-rates");
- Assert.True(response.StatusCode == HttpStatusCode.OK);
+ Assert.Equal(HttpStatusCode.OK, response.StatusCode);
var exchangeRates = await response.Content.ReadAsJsonAsync<List<ExchangeRate>>();
Assert.Single(exchangeRates);

MODIFY
WalletWasabi.Tests/RegressionTests/CoinJoinTests.cs
WalletWasabi.Tests/RegressionTests/CoinJoinTests.cs
@@ -647,10 +647,10 @@ public class CoinJoinTests
Assert.Contains(outputAddress1.ScriptPubKey, unsignedCoinJoin.Outputs.Select(x => x.ScriptPubKey));
Assert.Contains(outputAddress2.ScriptPubKey, unsignedCoinJoin.Outputs.Select(x => x.ScriptPubKey));
- Assert.True(2 == unsignedCoinJoin.Outputs.Count); // Because the two inputs are equal, so change addresses won't be used, nor coordinator fee will be taken.
+ Assert.Equal(2, unsignedCoinJoin.Outputs.Count); // Because the two inputs are equal, so change addresses won't be used, nor coordinator fee will be taken.
Assert.Contains(input1, unsignedCoinJoin.Inputs.Select(x => x.PrevOut));
Assert.Contains(input2, unsignedCoinJoin.Inputs.Select(x => x.PrevOut));
- Assert.True(2 == unsignedCoinJoin.Inputs.Count);
+ Assert.Equal(2, unsignedCoinJoin.Inputs.Count);
#endregion GetCoinjoin
@@ -1285,13 +1285,13 @@ public class CoinJoinTests
await chaumianClient1.DequeueCoinsFromMixAsync(new SmartCoin(randomStx, 0, randomKey), DequeueReason.UserRequested);
randomKey.SetAnonymitySet(1, randomStx.GetHash());
- Assert.True(2 == (await chaumianClient1.QueueCoinsToMixAsync(password, smartCoin1, smartCoin2)).Count());
+ Assert.Equal(2, (await chaumianClient1.QueueCoinsToMixAsync(password, smartCoin1, smartCoin2)).Count());
await chaumianClient1.DequeueCoinsFromMixAsync(smartCoin1, DequeueReason.UserRequested);
Assert.False(smartCoin1.CoinJoinInProgress);
await chaumianClient1.DequeueCoinsFromMixAsync(new[] { smartCoin1, smartCoin2 }, DequeueReason.UserRequested);
Assert.False(smartCoin1.CoinJoinInProgress);
Assert.False(smartCoin2.CoinJoinInProgress);
- Assert.True(2 == (await chaumianClient1.QueueCoinsToMixAsync(password, smartCoin1, smartCoin2)).Count());
+ Assert.Equal(2, (await chaumianClient1.QueueCoinsToMixAsync(password, smartCoin1, smartCoin2)).Count());
Assert.True(smartCoin1.CoinJoinInProgress);
Assert.True(smartCoin2.CoinJoinInProgress);
await chaumianClient1.DequeueCoinsFromMixAsync(smartCoin1, DequeueReason.UserRequested);
@@ -1299,10 +1299,10 @@ public class CoinJoinTests
Assert.False(smartCoin1.CoinJoinInProgress);
Assert.False(smartCoin2.CoinJoinInProgress);
- Assert.True(2 == (await chaumianClient1.QueueCoinsToMixAsync(password, smartCoin1, smartCoin2)).Count());
+ Assert.Equal(2, (await chaumianClient1.QueueCoinsToMixAsync(password, smartCoin1, smartCoin2)).Count());
Assert.True(smartCoin1.CoinJoinInProgress);
Assert.True(smartCoin2.CoinJoinInProgress);
- Assert.True(1 == (await chaumianClient2.QueueCoinsToMixAsync(password, smartCoin3)).Count());
+ Assert.Equal(1, (await chaumianClient2.QueueCoinsToMixAsync(password, smartCoin3)).Count());
Task timeout = Task.Delay(TimeSpan.FromSeconds(connectionConfirmationTimeout * 2 + 7 * 2 + 7 * 2 + 7 * 2));
while ((await rpc.GetRawMempoolAsync()).Length == 0)

MODIFY
WalletWasabi.Tests/UnitTests/Crypto/GroupElements/GeneralTests.cs
WalletWasabi.Tests/UnitTests/Crypto/GroupElements/GeneralTests.cs
@@ -96,10 +96,10 @@ public class GeneralTests
// Kinda clunky, but otherwise CodeFactor won't be happy.
GroupElement? n = null;
- Assert.False(ge == n);
+ Assert.NotEqual(ge, n);
Assert.True(ge != n);
- Assert.False(n == ge);
+ Assert.NotEqual(n, ge);
Assert.True(n != ge);
Assert.False(ge.Equals(n));

MODIFY
WalletWasabi.Tests/UnitTests/Crypto/ZeroKnowledge/LinearRelationTests.cs
WalletWasabi.Tests/UnitTests/Crypto/ZeroKnowledge/LinearRelationTests.cs
@@ -111,8 +111,8 @@ public class LinearRelationTests
// With different witnesses the responses should be different even if the
// nonces are the same, but since the first part of the witness is the
// same that sub-response should be the same for the same nonce
- Assert.False(response1 == response2);
- Assert.True(response1.First() == response2.First());
+ Assert.NotEqual(response1, response2);
+ Assert.Equal(response1.First(), response2.First());
}
[Fact]

MODIFY
WalletWasabi.Tests/UnitTests/SmartLabelTests.cs
WalletWasabi.Tests/UnitTests/SmartLabelTests.cs
@@ -84,7 +84,7 @@ public class SmartLabelTests
Assert.Equal(label4, label5);
Assert.NotEqual(label, label4);
Assert.False(label.Equals(label4));
- Assert.False(label == label4);
+ Assert.NotEqual(label, label4);
}
[Fact]

Use `Assert.{Equal|NotEqual}` instead of `Assert.{True|False}( ... == ...)`.