Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions test/integrationTests/codeActionRename.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,19 @@ suite(`Code Action Rename ${testAssetWorkspace.description}`, function() {

});

test("Code actions can remame and open files", async () => {
test("Code actions can rename and open files", async () => {
let fileUri = await testAssetWorkspace.projects[0].addFileWithContents("test.cs", "class C {}");
await vscode.commands.executeCommand("vscode.open", fileUri);
let c = await vscode.commands.executeCommand("vscode.executeCodeActionProvider", fileUri, new vscode.Range(0, 7, 0, 7)) as {command: string, title: string, arguments: string[]}[];
let command = c.find(
(s) => { return s.title == "Rename file to C.cs" }
)
(s) => { return s.title == "Rename file to C.cs"; }
);
expect(command, "Didn't find rename class command");
await vscode.commands.executeCommand(command.command, ...command.arguments)
expect(vscode.window.activeTextEditor.document.fileName).contains("C.cs");
});

teardown(async () => {
await testAssetWorkspace.cleanupWorkspace();
});
});
13 changes: 3 additions & 10 deletions test/integrationTests/hoverProvider.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,17 @@ const chai = require('chai');
chai.use(require('chai-arrays'));
chai.use(require('chai-fs'));

suite(`Tasks generation: ${testAssetWorkspace.description}`, function() {
suite(`Hover Provider: ${testAssetWorkspace.description}`, function() {
suiteSetup(async function() {
should();

await testAssetWorkspace.cleanupWorkspace();

let csharpExtension = vscode.extensions.getExtension("ms-vscode.csharp");
if (!csharpExtension.isActive) {
await csharpExtension.activate();
}

await csharpExtension.exports.initializationFinished;
await omnisharp.restart();

await vscode.commands.executeCommand("dotnet.generateAssets");

await poll(async () => await fs.exists(testAssetWorkspace.launchJsonPath), 10000, 100);

});

test("Hover returns structured documentation with proper newlines", async function () {
Expand All @@ -48,7 +41,7 @@ namespace Test
///<summary>Checks if object is tagged with the tag.</summary>
/// <param name="gameObject">The game object.</param>
/// <param name="tagName">Name of the tag.</param>
/// <returns>Returns <c> true</c> if object is tagged with tag.</returns>
/// <returns>Returns <c>true</c> if object is tagged with tag.</returns>

public static bool Compare(int gameObject,string tagName)
{
Expand All @@ -72,7 +65,7 @@ Parameters:
\t\tgameObject: The game object.
\t\ttagName: Name of the tag.

Returns true if object is tagged with tag.`;
Returns true if object is tagged with tag.`;
expect(c[0].contents[0].value).to.equal(answer);
});

Expand Down