Merge from master

This commit is contained in:
Raj Musuku
2019-02-21 17:56:04 -08:00
parent 5a146e34fa
commit 666ae11639
11482 changed files with 119352 additions and 255574 deletions

View File

@@ -12,7 +12,7 @@ import { CapabilitiesTestService } from 'sqltest/stubs/capabilitiesTestService';
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
import { formatServerNameWithDatabaseNameForAttachTo, getServerFromFormattedAttachToName, getDatabaseFromFormattedAttachToName } from 'sql/parts/notebook/notebookUtils';
describe('notebookUtils', function(): void {
suite('notebookUtils', function(): void {
let conn: IConnectionProfile = {
connectionName: '',
serverName: '',
@@ -30,7 +30,7 @@ describe('notebookUtils', function(): void {
azureTenantId: undefined
};
it('Should format server and database name correctly for attach to', async function(): Promise<void> {
test('Should format server and database name correctly for attach to', async function(): Promise<void> {
let capabilitiesService = new CapabilitiesTestService();
let connProfile = new ConnectionProfile(capabilitiesService, conn);
connProfile.serverName = 'serverName';
@@ -39,7 +39,7 @@ describe('notebookUtils', function(): void {
should(attachToNameFormatted).equal('serverName (databaseName)');
});
it('Should format server name correctly for attach to', async function(): Promise<void> {
test('Should format server name correctly for attach to', async function(): Promise<void> {
let capabilitiesService = new CapabilitiesTestService();
let connProfile = new ConnectionProfile(capabilitiesService, conn);
connProfile.serverName = 'serverName';
@@ -47,7 +47,7 @@ describe('notebookUtils', function(): void {
should(attachToNameFormatted).equal('serverName');
});
it('Should format server name correctly for attach to when database is undefined', async function(): Promise<void> {
test('Should format server name correctly for attach to when database is undefined', async function(): Promise<void> {
let capabilitiesService = new CapabilitiesTestService();
let connProfile = new ConnectionProfile(capabilitiesService, conn);
connProfile.serverName = 'serverName';
@@ -56,7 +56,7 @@ describe('notebookUtils', function(): void {
should(attachToNameFormatted).equal('serverName');
});
it('Should format server name as empty string when server/database are undefined', async function(): Promise<void> {
test('Should format server name as empty string when server/database are undefined', async function(): Promise<void> {
let capabilitiesService = new CapabilitiesTestService();
let connProfile = new ConnectionProfile(capabilitiesService, conn);
connProfile.serverName = undefined;
@@ -65,21 +65,21 @@ describe('notebookUtils', function(): void {
should(attachToNameFormatted).equal('');
});
it('Should extract server name when no database specified', async function(): Promise<void> {
test('Should extract server name when no database specified', async function(): Promise<void> {
let serverName = getServerFromFormattedAttachToName('serverName');
let databaseName = getDatabaseFromFormattedAttachToName('serverName');
should(serverName).equal('serverName');
should(databaseName).equal('');
});
it('Should extract server and database name', async function(): Promise<void> {
test('Should extract server and database name', async function(): Promise<void> {
let serverName = getServerFromFormattedAttachToName('serverName (databaseName)');
let databaseName = getDatabaseFromFormattedAttachToName('serverName (databaseName)');
should(serverName).equal('serverName');
should(databaseName).equal('databaseName');
});
it('Should extract server and database name with other parentheses', async function(): Promise<void> {
test('Should extract server and database name with other parentheses', async function(): Promise<void> {
let serverName = getServerFromFormattedAttachToName('serv()erName (databaseName)');
let databaseName = getDatabaseFromFormattedAttachToName('serv()erName (databaseName)');
should(serverName).equal('serv()erName');