Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 729c64f

Browse files
Allowing for a clearer assert exception if the test is incorrect
1 parent e989fdf commit 729c64f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/GitHub.App.UnitTests/ViewModels/Dialog/Clone/RepositoryCloneViewModelTests.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.ComponentModel;
3+
using System.Linq;
34
using System.Linq.Expressions;
45
using System.Numerics;
56
using System.Threading.Tasks;
@@ -59,8 +60,9 @@ public async Task IncrementCounter_Showing_Default_Tab(string address, bool isGr
5960

6061
await target.InitializeAsync(connection).ConfigureAwait(false);
6162

62-
await usageTracker.Received(1).IncrementCounter(Arg.Is<Expression<Func<UsageModel.MeasuresModel, int>>>(
63-
x => x.ToString() == expressionString)).ConfigureAwait(false);
63+
await usageTracker.Received(1).IncrementCounter(Arg.Any<Expression<Func<UsageModel.MeasuresModel, int>>>()).ConfigureAwait(false);
64+
var expression = (Expression<Func<UsageModel.MeasuresModel, int>>) usageTracker.ReceivedCalls().First().GetArguments()[0];
65+
Assert.AreEqual(expressionString, expression.ToString());
6466
}
6567

6668
[Test]

0 commit comments

Comments
 (0)