Skip to content

Commit faa89ac

Browse files
authored
Merge pull request #4045 from MattSturgeon/fix-Test_PrepareRequest-version
Use dynamic version in `EventTrackerTests.Test_PrepareRequest`
2 parents 8c79a3c + 00f40a4 commit faa89ac

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

tests/NexusMods.Backend.Tests/EventTrackerTests.Test_PrepareRequest.verified.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
properties: {
55
time: 0,
66
app_name: Nexus Mods App,
7-
app_version: 0.0.1,
7+
app_version: {{app_version}},
88
platform_type: app,
99
token: Guid_1,
1010
$device_id: Guid_Empty,
@@ -22,7 +22,7 @@
2222
properties: {
2323
time: 0,
2424
app_name: Nexus Mods App,
25-
app_version: 0.0.1,
25+
app_version: {{app_version}},
2626
platform_type: app,
2727
token: Guid_1,
2828
$device_id: Guid_Empty,
@@ -40,7 +40,7 @@
4040
properties: {
4141
time: 0,
4242
app_name: Nexus Mods App,
43-
app_version: 0.0.1,
43+
app_version: {{app_version}},
4444
platform_type: app,
4545
token: Guid_1,
4646
$device_id: Guid_Empty,
@@ -58,7 +58,7 @@
5858
properties: {
5959
time: 0,
6060
app_name: Nexus Mods App,
61-
app_version: 0.0.1,
61+
app_version: {{app_version}},
6262
platform_type: app,
6363
token: Guid_1,
6464
$device_id: Guid_Empty,
@@ -76,7 +76,7 @@
7676
properties: {
7777
time: 0,
7878
app_name: Nexus Mods App,
79-
app_version: 0.0.1,
79+
app_version: {{app_version}},
8080
platform_type: app,
8181
token: Guid_1,
8282
$device_id: Guid_Empty,

tests/NexusMods.Backend.Tests/EventTrackerTests.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using NexusMods.Abstractions.NexusWebApi;
66
using NexusMods.Backend.Tracking;
77
using NexusMods.Paths;
8+
using NexusMods.Sdk;
89
using NexusMods.Sdk.Settings;
910
using NexusMods.Sdk.Tracking;
1011
using NSubstitute;
@@ -52,6 +53,10 @@ public async Task Test_PrepareRequest()
5253
await Assert.That(buffer).IsNotNull();
5354

5455
var json = Encoding.UTF8.GetString(buffer!.WrittenSpan);
55-
await VerifyJson(json);
56+
await VerifyJson(json)
57+
.AddScrubber(s => s.Replace(
58+
ApplicationConstants.Version.ToSafeString(maxFieldCount: 3),
59+
"{{app_version}}"
60+
));
5661
}
5762
}

0 commit comments

Comments
 (0)