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

Commit cf74826

Browse files
Stubbing user data and validating the data parse
1 parent c032eff commit cf74826

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/UnitTests/GitHub.VisualStudio/Services/MetricsTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -425,13 +425,12 @@ static IUsageService CreateUsageService(
425425

426426
public class UsageServiceTests : TestBaseClass
427427
{
428-
private const string DefaultUserStoreContent =
429-
@"
430-
";
431-
private const string DefaultUsageContent =
432-
@"
433-
";
434-
private const string LegacyUsageContent =
428+
private static readonly Guid UserGuid = Guid.NewGuid();
429+
private static readonly string DefaultUserStoreContent = @"{""UserGuid"":""" + UserGuid + @"""}";
430+
431+
private static readonly string DefaultUsageContent = string.Empty;
432+
433+
private static readonly string LegacyUsageContent =
435434
@"{
436435
""LastUpdated"": ""2018-02-28T12:37:09.4771538Z"",
437436
""Model"": {
@@ -522,6 +521,7 @@ public async Task GetUserGuidWorks()
522521
{
523522
var usageService = new UsageService(Substitute.For<IGitHubServiceProvider>(), environment);
524523
var guid = await usageService.GetUserGuid();
524+
Assert.IsTrue(guid.Equals(UserGuid));
525525
}
526526

527527
[Test]

0 commit comments

Comments
 (0)