This commit is contained in:
Jan Jones 2023-10-09 12:07:14 +03:00
Родитель 16427189ee
Коммит f5ea348f87
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: D1C5B3CEF23E7C8D
6 изменённых файлов: 15 добавлений и 13 удалений

Просмотреть файл

@ -908,7 +908,9 @@ public class DefaultRazorProjectServiceTest : LanguageServerTestBase
// We updated the project in the DocumentChanged callback, so we expect to get a new snapshot
Assert.NotSame(ownerProject.GetDocument(documentFilePath), snapshot);
Assert.Equal(documentFilePath, snapshot.FilePath);
#pragma warning disable xUnit1031 // Do not use blocking task operations in test method
Assert.Equal(newText, snapshot.GetTextAsync().Result);
#pragma warning restore xUnit1031
Assert.Equal(1337, version);
});
var projectSnapshotManager = new Mock<ProjectSnapshotManagerBase>(MockBehavior.Strict);

Просмотреть файл

@ -40,7 +40,7 @@ public class DefaultWorkspaceSemanticTokensRefreshPublisherTest : LanguageServer
testAccessor.WaitForEmpty();
// Assert
Assert.Equal(0, serverClient.Requests.Count);
Assert.Empty(serverClient.Requests);
}
[Fact]

Просмотреть файл

@ -616,7 +616,7 @@ public class DefaultVisualStudioRazorParserTest : ProjectSnapshotManagerDispatch
parser.StartParser();
// Assert
Assert.Equal(1, textBuffer.AttachedChangedEvents.Count);
Assert.Single(textBuffer.AttachedChangedEvents);
Assert.NotNull(parser._parser);
}
}

Просмотреть файл

@ -101,7 +101,7 @@ public class DefaultLSPDocumentFactoryTest : TestBase
var lspDocument = factory.Create(textBuffer);
// Assert
Assert.Equal(0, lspDocument.VirtualDocuments.Count);
Assert.Empty(lspDocument.VirtualDocuments);
}
[Fact]

Просмотреть файл

@ -83,7 +83,7 @@ public class RazorLSPSpanMappingServiceTest : TestBase
var expectedResult = (expectedFilePath, expectedLinePosition, expectedSpan);
// Act
var result = await service.MapSpansAsyncTest(spans, _sourceTextGenerated, _sourceTextRazor).ConfigureAwait(false);
var result = await service.MapSpansAsyncTest(spans, _sourceTextGenerated, _sourceTextRazor);
// Assert
Assert.True(called);
@ -120,7 +120,7 @@ public class RazorLSPSpanMappingServiceTest : TestBase
var service = new RazorLSPSpanMappingService(documentMappingProvider.Object, documentSnapshot.Object, textSnapshot);
// Act
var result = await service.MapSpansAsyncTest(spans, _sourceTextGenerated, _sourceTextRazor).ConfigureAwait(false);
var result = await service.MapSpansAsyncTest(spans, _sourceTextGenerated, _sourceTextRazor);
// Assert
Assert.True(called);

Просмотреть файл

@ -68,7 +68,7 @@ public class RazorProjectInfoPublisherTest : LanguageServerTestBase
// Assert
var stalePublishTask = Assert.Single(publisher.DeferredPublishTasks);
await stalePublishTask.Value.ConfigureAwait(false);
await stalePublishTask.Value;
Assert.True(serializationSuccessful);
}
@ -150,7 +150,7 @@ public class RazorProjectInfoPublisherTest : LanguageServerTestBase
await RunOnDispatcherThreadAsync(() =>
{
_projectSnapshotManager.DocumentOpened(hostProject.Key, hostDocument.FilePath, SourceText.From(string.Empty));
}).ConfigureAwait(false);
});
// Assert
@ -189,7 +189,7 @@ public class RazorProjectInfoPublisherTest : LanguageServerTestBase
// Assert
var kvp = Assert.Single(publisher.DeferredPublishTasks);
await kvp.Value.ConfigureAwait(false);
await kvp.Value;
Assert.True(serializationSuccessful);
}
@ -226,7 +226,7 @@ public class RazorProjectInfoPublisherTest : LanguageServerTestBase
// Flush publish task
var kvp = Assert.Single(publisher.DeferredPublishTasks);
await kvp.Value.ConfigureAwait(false);
await kvp.Value;
aboutToChange = true;
publisher.DeferredPublishTasks.Clear();
@ -264,7 +264,7 @@ public class RazorProjectInfoPublisherTest : LanguageServerTestBase
// Assert
var kvp = Assert.Single(publisher.DeferredPublishTasks);
await kvp.Value.ConfigureAwait(false);
await kvp.Value;
Assert.False(attemptedToSerialize);
}
@ -298,7 +298,7 @@ public class RazorProjectInfoPublisherTest : LanguageServerTestBase
// Assert
var kvp = Assert.Single(publisher.DeferredPublishTasks);
await kvp.Value.ConfigureAwait(false);
await kvp.Value;
Assert.True(serializationSuccessful);
}
@ -331,7 +331,7 @@ public class RazorProjectInfoPublisherTest : LanguageServerTestBase
// Assert
var kvp = Assert.Single(publisher.DeferredPublishTasks);
await kvp.Value.ConfigureAwait(false);
await kvp.Value;
Assert.True(serializationSuccessful);
}
@ -370,7 +370,7 @@ public class RazorProjectInfoPublisherTest : LanguageServerTestBase
// Assert
var kvp = Assert.Single(publisher.DeferredPublishTasks);
await kvp.Value.ConfigureAwait(false);
await kvp.Value;
Assert.False(serializationSuccessful);
}