Added notification for when language service is done updating after connect (#146)

* Added notification for when language service is done updating after connect

* Addressing feedback

* Added unit test
This commit is contained in:
Mitchell Sternke
2016-11-15 17:39:17 -08:00
committed by GitHub
parent f2b8a16d29
commit 2211bd0403
4 changed files with 56 additions and 1 deletions

View File

@@ -93,6 +93,7 @@ namespace Microsoft.SqlTools.ServiceLayer.TestDriver.Driver
// Setup events to queue for testing
this.QueueEventsForType(ConnectionCompleteNotification.Type);
this.QueueEventsForType(IntelliSenseReadyNotification.Type);
this.QueueEventsForType(QueryExecuteCompleteEvent.Type);
this.QueueEventsForType(PublishDiagnosticsNotification.Type);
}

View File

@@ -258,5 +258,26 @@ namespace Microsoft.SqlTools.ServiceLayer.TestDriver.Tests
}
}
[Fact]
public async Task NotificationIsSentAfterOnConnectionAutoCompleteUpdate()
{
try
{
// Connect
string ownerUri = System.IO.Path.GetTempFileName();
await Connect(ownerUri, ConnectionTestUtils.LocalhostConnection);
// An event signalling that IntelliSense is ready should be sent shortly thereafter
var readyParams = await Driver.WaitForEvent(IntelliSenseReadyNotification.Type, 30000);
Assert.NotNull(readyParams);
Assert.Equal(ownerUri, readyParams.OwnerUri);
await Disconnect(ownerUri);
}
finally
{
WaitForExit();
}
}
}
}