зеркало из https://github.com/dotnet/razor.git
Fix xUnit code warnings
This commit is contained in:
Родитель
16427189ee
Коммит
f5ea348f87
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче